uzlib
uzlib copied to clipboard
UZLIB_CONF_USE_MEMCPY option bug
memcpy cannot be used, because memory region may overlap (the behavior is undefined). copy must be made byte by byte.
Simple check with tgunzip:
- set UZLIB_CONF_USE_MEMCPY to 1
- set OUT_CHUNK_SIZE to 1024
- do not use ring buffer
- try decopress simple text file (
12341234123411111113333333). I attach test.gz - tgunzip return
Error during decompression: -4(TINF_CHKSUM_ERROR)
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.