[Webkit-unassigned] [Bug 256330] Unexpected "Extra bytes past the end" error when decompressing data with DecompressionStream

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 5 13:50:36 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=256330

--- Comment #10 from gildas <gildas.lormeau at gmail.com> ---
I was able to find an example of code to reproduce the issue inspired from this thread on SO: https://stackoverflow.com/questions/67526864/how-to-inflate-a-gzip-with-a-really-old-zlib.

Steps to reproduce the issue:
- Open a new tab in Safari
- Open the developer tools
- Run the code below
`
(async () => {
        const result = new TransformStream();
        (new Blob([new Uint8Array([0xec, 0x9a, 0x7f, 0x54, 0x1c, 0x55, 0x96, 0xc7, 0x6f, 0x75, 0x37, 0xd0, 0xfc, 0x70])])).stream().pipeThrough(new DecompressionStream("deflate-raw")).pipeTo(result.writable);
        console.log(await new Response(result.readable).blob());
})();
`

Expected result:
An error similar to "TypeError: The input is ended without reaching the stream end" (Firefox) or "TypeError: Compressed input was truncated." (Chrome) should be thrown.

Result in Safari 16.4:
The error "TypeError: Extra bytes past the end." is thrown instead.

The code run as expected in:
- Firefox nightly: yes
- Chrome: yes

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230505/d605442a/attachment-0001.htm>


More information about the webkit-unassigned mailing list