mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
fs/hfsplus: Fix memory leak in grub_hfsplus_btree_search()
Fixes: 58ea11d5b (fs/hfsplus: Don't fetch a key beyond the end of the node)
Signed-off-by: t.feng <fengtao40@huawei.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
1 parent
6cdd08b362
commit
a1e05167c8
1 file changed
+3
@@ -652,7 +652,10 @@ grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree,
|
|||||||
+ 2);
|
+ 2);
|
||||||
|
|
||||||
if ((char *) pointer > node + btree->nodesize - 2)
|
if ((char *) pointer > node + btree->nodesize - 2)
|
||||||
|
{
|
||||||
|
grub_free (node);
|
||||||
return grub_error (GRUB_ERR_BAD_FS, "HFS+ key beyond end of node");
|
return grub_error (GRUB_ERR_BAD_FS, "HFS+ key beyond end of node");
|
||||||
|
}
|
||||||
|
|
||||||
currnode = grub_be_to_cpu32 (grub_get_unaligned32 (pointer));
|
currnode = grub_be_to_cpu32 (grub_get_unaligned32 (pointer));
|
||||||
match = 1;
|
match = 1;
|
||||||
|
|||||||
Reference in new issue
Block a user