[PATCH 2/2] gzio: Properly init a table

2024-05-12 Thread Daniel Axtens
ARRAY_SIZE is the count of elements, but the element size is 4 bytes, so this was only initing the first 1/4th of the table. Detected with valgrind. This should only matter in error paths, and I've not been able to identify any actual misbehaviour that results from reading in-bounds but uninited d

[PATCH 1/2] gzio: abort early when get_byte reads nothing

2024-05-12 Thread Daniel Axtens
This isn't intended to be a functional change, but it makes a lot of failures a lot faster, which is extremely helpful for fuzzing. Without this change, we keep trying and trying to read more bytes into our buffer, never being able to (read always returns 0) and so we just return old buffer con

[PATCH 0/2] Two small fixes to gzip

2024-05-12 Thread Daniel Axtens
I've been fuzzing gzip a bit. So far nothing super exciting, but it's helpful to add some code to bail early on EOF (patch 1) and to avoid some uninitialised data warnings from valgrind (patch 2). I'm not aware of any security implications of either change, and the gzip compression test still pass