]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Do NULL pointer check before the pointer is used.
authorQiu Shumin <shumin.qiu@intel.com>
Mon, 22 Feb 2016 02:21:38 +0000 (10:21 +0800)
committerQiu Shumin <shumin.qiu@intel.com>
Tue, 23 Feb 2016 02:44:36 +0000 (10:44 +0800)
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>
ShellPkg/Library/UefiShellLib/UefiShellLib.c

index 70852a93f298097023a1f49791f1911a9a414d1f..cf89a4ac87edb844ad2bfe3962bec4f3ec09e874 100644 (file)
@@ -4071,7 +4071,7 @@ ShellFileHandleReturnLine(
     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