[issue45509] Gzip header corruption not properly checked.

2021-11-24 Thread Ruben Vorderman
Ruben Vorderman added the comment: I have found that using the timeit module provides more precise measurements: For a simple gzip header. (As returned by gzip.compress or zlib.compress with wbits=31) ./python -m timeit -s "import io; data = b'\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03\x03\x00

[issue45509] Gzip header corruption not properly checked.

2021-11-22 Thread Ruben Vorderman
Ruben Vorderman added the comment: I increased the performance of the patch. I added the file used for benchmarking. I also test the FHCRC changes now. The benchmark tests headers with different flags concatenated to a DEFLATE block with no data and a gzip trailer. The data is fed to gzip.de

[issue45509] Gzip header corruption not properly checked.

2021-11-22 Thread Ruben Vorderman
Ruben Vorderman added the comment: 1. Quite a lot I tested it for the two most common use case. import timeit import statistics WITH_FNAME = """ from gzip import GzipFile, decompress import io fileobj = io.BytesIO() g = GzipFile(fileobj=fileobj, mode='wb', filename='compressable_file') g.wri

[issue45509] Gzip header corruption not properly checked.

2021-11-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it is good idea, although we may get reports about regressions in 3.11 when Python will start to reject GZIP files which was successfully read before. But before merging this I want to know: 1. How much overhead does it add for reading files with t

[issue45509] Gzip header corruption not properly checked.

2021-11-22 Thread Ruben Vorderman
Ruben Vorderman added the comment: Ping -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue45509] Gzip header corruption not properly checked.

2021-11-05 Thread Ruben Vorderman
Ruben Vorderman added the comment: Bump. This is a bug that allows corrupted gzip files to be processed without error. Therefore I bump this issue in the hopes someone will review the PR. -- ___ Python tracker

[issue45509] Gzip header corruption not properly checked.

2021-10-18 Thread Ruben Vorderman
Change by Ruben Vorderman : -- keywords: +patch pull_requests: +27300 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29028 ___ Python tracker ___

[issue45509] Gzip header corruption not properly checked.

2021-10-18 Thread Ruben Vorderman
New submission from Ruben Vorderman : The following headers are currently allowed while being wrong: - Headers with FCOMMENT flag set, but with incomplete or missing COMMENT bytes. - Headers with FNAME flag set, but with incomplete or missing NAME bytes - Headers with FHCRC set, the crc is read