// you should set the status string\r
//\r
Status = ReadFileIntoBuffer (FileName, (VOID**)&Buffer, &HFileImage.Size, &HFileImage.ReadOnly);\r
- if (EFI_ERROR(Status)) {\r
+ if (EFI_ERROR(Status) || Buffer == NULL) {\r
UnicodeBuffer = CatSPrint(NULL, L"Read error on file &s: %r", FileName, Status);\r
if (UnicodeBuffer == NULL) {\r
SHELL_FREE_NON_NULL(Buffer);\r