pfalcon / uzlib

Radically unbloated DEFLATE/zlib/gzip compression/decompression library. Can decompress any gzip/zlib data, and offers simplified compressor which produces gzip-compatible output, while requiring much less resources (and providing less compression ratio of course).
Other
302 stars 82 forks source link

UZLIB_CONF_USE_MEMCPY option bug #50

Open udovichenkoAlexander opened 1 month ago

udovichenkoAlexander commented 1 month ago

memcpy cannot be used, because memory region may overlap (the behavior is undefined). copy must be made byte by byte.

Simple check with tgunzip: 1) set UZLIB_CONF_USE_MEMCPY to 1 2) set OUT_CHUNK_SIZE to 1024 3) do not use ring buffer 4) try decopress simple text file (12341234123411111113333333). I attach test.gz 5) tgunzip return Error during decompression: -4 (TINF_CHKSUM_ERROR)

test.txt test.gz

pfalcon commented 2 weeks ago

Thanks for the report and testcase. Apparently, needs to be replaced by memmove(). Sadly, I don't have enough resource to work on the project now, so that will have to wait.