]> git.ipfire.org Git - thirdparty/grub.git/commit
commands/file: Fix NULL dereference in the knetbsd tests
authorLukas Fink <lukas.fink1@gmail.com>
Sun, 5 Jan 2025 08:24:11 +0000 (02:24 -0600)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 26 Feb 2025 18:34:57 +0000 (19:34 +0100)
commit7161e2437dda654c69b930edb2fd18bbfe5c1f05
tree924e6b76f5a6e2d44c25779e64aafd863f6d02de
parent11b9c2dd0d341a319209b8555db2d5d1f13fa152
commands/file: Fix NULL dereference in the knetbsd tests

The pointer returned by grub_elf_file() is not checked to verify it is
not NULL before use. A NULL pointer may be returned when the given file
does not have a valid ELF header.

Fixes: https://savannah.gnu.org/bugs/?61960
Signed-off-by: Glenn Washburn <development@efficientek.com>
Signed-off-by: Lukas Fink <lukas.fink1@gmail.com>
Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/commands/file.c