Skip to content

Commit

Permalink
Ext4Pkg: Add missing exit status in Ext4OpenDirent
Browse files Browse the repository at this point in the history
Missing EFI_OUT_OF_RESOURCES exit status on failed Ext4CreateDentry
leads to NULL-pointer dereference in Ext4GetFileInfo (passing NULL
buffer in Ext4ReadDir)

Cc: Marvin Häuser <[email protected]>
Cc: Pedro Falcato <[email protected]>
Cc: Vitaly Cheptsov <[email protected]>
Fixes: 21b1853 ("Ext4Pkg: Add a directory entry tree.")
Signed-off-by: Savva Mitrofanov <[email protected]>
Reviewed-by: Pedro Falcato <[email protected]>
Reviewed-by: Marvin Häuser <[email protected]>
  • Loading branch information
savvamitrofanov authored and heatd committed Feb 8, 2023
1 parent dc30a62 commit 1f5c4f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Features/Ext4Pkg/Ext4Dxe/Directory.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ Ext4OpenDirent (
} else {
File->Dentry = Ext4CreateDentry (FileName, Directory->Dentry);

if (!File->Dentry) {
if (File->Dentry == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Error;
}
}
Expand Down

0 comments on commit 1f5c4f7

Please sign in to comment.