Skip to content

Commit

Permalink
Fixed null pointer dereference issue in treeblock
Browse files Browse the repository at this point in the history
  • Loading branch information
TronciuVlad authored and trufae committed Feb 12, 2024
1 parent 1ee768a commit 8419d7d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions shlr/grub/fs/sfs.c
Expand Up @@ -159,6 +159,9 @@ grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block,
return 0;

treeblock = grub_malloc (data->blocksize);
if(!treeblock){
return grub_error(GRUB_ERR_OUT_OF_MEMORY, "Failed to allocate memory for treeblock");
}

next = grub_be_to_cpu32 (data->rblock.btree);
tree = (struct grub_sfs_btree *) treeblock;
Expand Down

0 comments on commit 8419d7d

Please sign in to comment.