From 9b93141dd0f39af70a867231ce8ba7cb34cd23e6 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 30 Jul 2014 15:34:15 -0700 Subject: Upgrade LZ4 to latest version. --- node/Packet.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'node') diff --git a/node/Packet.hpp b/node/Packet.hpp index a569cde3..ddafe4ee 100644 --- a/node/Packet.hpp +++ b/node/Packet.hpp @@ -993,7 +993,7 @@ public: if ((compressed())&&(size() >= ZT_PROTO_MIN_PACKET_LENGTH)) { if (size() > ZT_PACKET_IDX_PAYLOAD) { unsigned int compLen = size() - ZT_PACKET_IDX_PAYLOAD; - int ucl = LZ4_uncompress_unknownOutputSize((const char *)field(ZT_PACKET_IDX_PAYLOAD,compLen),(char *)buf,compLen,sizeof(buf)); + int ucl = LZ4_decompress_safe((const char *)field(ZT_PACKET_IDX_PAYLOAD,compLen),(char *)buf,compLen,sizeof(buf)); if ((ucl > 0)&&(ucl <= (int)(capacity() - ZT_PACKET_IDX_PAYLOAD))) { setSize((unsigned int)ucl + ZT_PACKET_IDX_PAYLOAD); memcpy(field(ZT_PACKET_IDX_PAYLOAD,(unsigned int)ucl),buf,ucl); -- cgit v1.2.3