You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
At least in certain circumstances, when decompressing truncated compressed input, calling ZSTD_decompressStream() with input = {NULL, 0, 0} computes NULL + 0 here:
Fix an instance of `NULL + 0` in `ZSTD_decompressStream()`. Also, improve our
`stream_decompress` fuzzer to pass `NULL` in/out buffers to
`ZSTD_decompressStream()`, and fix 2 issues that were immediately surfaced.
Fixesfacebook#3351
Fix an instance of `NULL + 0` in `ZSTD_decompressStream()`. Also, improve our
`stream_decompress` fuzzer to pass `NULL` in/out buffers to
`ZSTD_decompressStream()`, and fix 2 issues that were immediately surfaced.
Fixes#3351
Describe the bug
At least in certain circumstances, when decompressing truncated compressed input, calling
ZSTD_decompressStream()
withinput = {NULL, 0, 0}
computesNULL + 0
here:zstd/lib/decompress/zstd_decompress.c
Line 2169 in e767d5c
which is UB in C, detected by ubsan (
nullptr-with-offset
), even though it is benign in practice.To Reproduce
I could try extracting a test case, but I would prefer to avoid unnecessary work. The fix should be uncontroversial.
Expected behavior
Decompression successfully stops wanting more input, even under ubsan.
Possible fix:
Our randomized tests succeed with this fix many times, which suggests that this is the only place to fix for this issue.
The text was updated successfully, but these errors were encountered: