-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
Describe the bug
A legacy v0.5 frame (magic 0xFD2FB525) decodes to different outputs depending on whether it is processed via ZSTD_decompress or ZSTD_decompressStream. Both APIs report success and produce the same output length, but the contents differ.
To Reproduce
- Place the attached reproducer legacy_stream_mismatch.c in
tests/reproducers - Add the following to
build/cmake/tests/CMakeLists.txt
add_executable(legacy_stream_mismatch ${TESTS_DIR}/reproducers/legacy_stream_mismatch.c)
target_link_libraries(legacy_stream_mismatch libzstd_static)
Build and run:
cmake -S . -B build/repro -DZSTD_BUILD_TESTS=ON -DZSTD_LEGACY_SUPPORT=5
cmake --build build/repro --config Release --target legacy_stream_mismatch
./build/repro/build/cmake/tests/legacy_stream_mismatchOutput:
Mismatch: one_shot_size=283 stream_size=283 first_diff=14 (one_shot=0x4e, stream=0x68)
one_shot text:
NNNNNNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNNNNhNNNNNhhhhhhhhhhhh
streamed text:
NNNNNNNNNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNNNNhhhhNNhhhhhhhhhhhh
Expected behavior
Decoded bytes should be the same using both APIs.
Desktop (please complete the following information):
- OS: Linux
- Version: current working tree (1.5.8 at time of report)
- Compiler: gcc & clang
Cyan4973
Metadata
Metadata
Assignees
Labels
No labels