Merge pull request #6115 from SKlimaRA/SKlimaRA/fix-decompress-dynamic

fixed heap corruption
This commit is contained in:
JacobBarthelmeh
2023-02-21 11:58:11 -07:00
committed by GitHub

View File

@ -286,7 +286,7 @@ int wc_DeCompressDynamic(byte** out, int maxSz, int memoryType,
XFREE(tmp, heap, memoryType); XFREE(tmp, heap, memoryType);
tmp = newTmp; tmp = newTmp;
stream.next_out = tmp + stream.total_out; stream.next_out = tmp + stream.total_out;
stream.avail_out = stream.avail_out + (uInt)tmpSz; stream.avail_out = stream.avail_out + (uInt)inSz;
tmpSz = newSz; tmpSz = newSz;
result = inflate(&stream, Z_BLOCK); result = inflate(&stream, Z_BLOCK);
} }