]> git.ipfire.org Git - thirdparty/grub.git/commit
io/gzio: Abort early when get_byte() reads nothing
authorDaniel Axtens <dja@axtens.net>
Sun, 12 May 2024 14:32:08 +0000 (00:32 +1000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 6 Jun 2024 14:55:15 +0000 (16:55 +0200)
commit243682baaa31b760d110acd20fa397d2e8616ebc
tree29137ed9024df75f63b847c20fe2ea793951cee3
parentbb65d81fe320e4b20d0a9b32232a7546eb275ecc
io/gzio: Abort early when get_byte() reads nothing

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 contents
over and over until the decompression process fails some other way.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/io/gzio.c