Compression module may truncate decompressed size on 32-bit platforms #65
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
In
src/shared/compression.clines 48-49:ZSTD_getFrameContentSize()returnsunsigned long long, but it is assigned tosize_ton 32-bit platforms, wheresize_tis 32 bits. If a compressed frame has a decompressed size larger than 4GB, the value will be truncated.Additionally, the decompression loop grows the buffer by doubling (line 83:
buf_size *= 2), which can quickly exhaust memory on 32-bit systems.Location
src/shared/compression.c:48-63Suggested Fix
Validate that
dst_sizefits insize_tbefore using it:Severity
Low
Category
Bug