From 504558b4ef29d6637df05a31a07ec67711e71544 Mon Sep 17 00:00:00 2001 From: Savva Mitrofanov Date: Wed, 30 Nov 2022 18:44:32 +0600 Subject: [PATCH] Ext4Pkg: Add missing exit Status in Ext4OpenDirent Missing EFI_OUT_OF_RESOURCES exit status on failed Ext4CreateDentry leads to NULL-pointer dereference in Ext4GetFileInfo (passing NULL buffer in Ext4ReadDir) Signed-off-by: Savva Mitrofanov --- Ext4Pkg/Ext4Dxe/Directory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Ext4Pkg/Ext4Dxe/Directory.c b/Ext4Pkg/Ext4Dxe/Directory.c index ff476c8641..efdce14772 100644 --- a/Ext4Pkg/Ext4Dxe/Directory.c +++ b/Ext4Pkg/Ext4Dxe/Directory.c @@ -260,7 +260,8 @@ Ext4OpenDirent ( } else { File->Dentry = Ext4CreateDentry (FileName, Directory->Dentry); - if (!File->Dentry) { + if (File->Dentry == NULL) { + Status = EFI_OUT_OF_RESOURCES; goto Error; } }