-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Hi,
I happened upon an odd bug when attempting to decompress data which was not a valid brotli stream using the C# library which caused my application to hang. I tracked the bug to this line:
brotli/csharp/org/brotli/dec/BitReader.cs
Line 257 in d74b0a4
| if (len == -1) |
The Read method will never return -1, it returns 0 on EoF (I think this is just a translation error from Java, this same issue is noted here:
brotli/csharp/org/brotli/dec/BitReader.cs
Line 79 in d74b0a4
| // EOF is -1 in Java, but 0 in C#. |
The fix should just be to change -1 to 0 - this correctly triggered the BrotliRuntimeException in my code.
Metadata
Metadata
Assignees
Labels
No labels