summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c')
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
index 8562662638..f5fb7d262a 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
@@ -169,7 +169,7 @@ HFileImageRead (
// you should set the status string
//
Status = ReadFileIntoBuffer (FileName, (VOID**)&Buffer, &HFileImage.Size, &HFileImage.ReadOnly);
- if (EFI_ERROR(Status)) {
+ if (EFI_ERROR(Status) || Buffer == NULL) {
UnicodeBuffer = CatSPrint(NULL, L"Read error on file &s: %r", FileName, Status);
if (UnicodeBuffer == NULL) {
SHELL_FREE_NON_NULL(Buffer);