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
gzip/inflate: harden GZIP header parsing and ISIZE validation
- gzs(): reject reserved FLG bits (0xE0); add bounds checks for
FEXTRA length field before reading it to prevent out-of-bounds access
on truncated headers
- gzl(): reject ISIZE values above Int range (>= 0x80000000); now raises
FzipError instead of returning a negative Int
- gunzip_sync(): validate ISIZE against max_output_size before allocating
the output buffer; verify that inflate wrote exactly isize bytes and
raise InvalidZipData on mismatch; call trim_buf() to return a
correctly sized slice when a caller-supplied oversized buffer is used
- inflate/inflt(): reject code-length repeat symbol 16 (copy previous)
when it appears at index 0 (no previous value); reject repeat counts
that would overflow the code-length table
- Update GunzipOptions doc comment to reflect that ISIZE is now checked
against max_output_size and that max_output_size is a hard limit
- Add tests: ISIZE > max_output_size before allocation, ISIZE mismatch
after inflate, oversized caller buffer trimmed correctly, FEXTRA
truncated length, FEXTRA length exceeds input, reserved FLG bits
rejected, code-length repeat 16 at index 0, repeat count overflow
0 commit comments