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
We've run into an issue where bad input data caused the library to keep spinning in decompression_reader.c:370 as seen on the screenshot from py-spy stacktrace dump.
Here's the code to reproduce this situation:
import zstandard
import io
decompressor = zstandard.ZstdDecompressor()
bad_input = b''
with decompressor.stream_reader(bad_input) as decompressing_reader:
with io.TextIOWrapper(decompressing_reader, encoding='utf-8', newline='\n') as reader:
for line in reader:
print(line)
The text was updated successfully, but these errors were encountered:
The bug here is that the C backend implementation of ZstdDecompressionReader.read1() will infinite loop for inputs conforming to the buffer protocol having 0 length. This appeared to evade test coverage (including fuzzing) because we never sent an empty input into the fuzz tests. I'll change that as part of fixing this.
Hi there!
We've run into an issue where bad input data caused the library to keep spinning in
decompression_reader.c:370
as seen on the screenshot frompy-spy
stacktrace dump.Here's the code to reproduce this situation:
The text was updated successfully, but these errors were encountered: