]> git.ipfire.org Git - thirdparty/grub.git/commit
fs/hfsplus: Set grub_errno to prevent NULL pointer access
authorLidong Chen <lidong.chen@oracle.com>
Wed, 3 May 2023 17:32:19 +0000 (17:32 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 17 May 2023 16:19:02 +0000 (18:19 +0200)
commit61b13c187c9f2ef4dc2f1b450ff5de4008f28a50
treeaba37429881396a2af44111f2cff63196b38d693
parenteb8b0aabb8ab8adab88d3610496e191097adba5a
fs/hfsplus: Set grub_errno to prevent NULL pointer access

When an invalid node size is detected in grub_hfsplus_mount(), data
pointer is freed. Thus, file->data is not set. The code should also
set the grub_errno when that happens to indicate an error and to avoid
accessing the uninitialized file->data in grub_file_close().

Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/fs/hfsplus.c