Do NULL pointer check before the pointer is used to avoid dereferenced.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Status = ShellFileHandleReadLine(Handle, RetVal, &Size, FALSE, Ascii);\r
\r
}\r
- if (Status == EFI_END_OF_FILE && *RetVal != CHAR_NULL) {\r
+ if (Status == EFI_END_OF_FILE && RetVal != NULL && *RetVal != CHAR_NULL) {\r
Status = EFI_SUCCESS;\r
}\r
if (EFI_ERROR(Status) && (RetVal != NULL)) {\r