summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQiu Shumin <shumin.qiu@intel.com>2016-02-22 10:21:38 +0800
committerLeif Lindholm <leif.lindholm@linaro.org>2016-02-23 17:57:50 +0000
commit9f4c24b9e4586963df19c9871e0ff41c8971f0e8 (patch)
treee74868d36d5b731a4f96add497ef3848315843cf
parente34bd47b636e35d63d3887bb66ad0b4fb90c797b (diff)
ShellPkg: Do NULL pointer check before the pointer is used.linaro-edk2-2016.02-rc1linaro-edk2-2016.02release
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>
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index 70852a93f2..cf89a4ac87 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -4071,7 +4071,7 @@ ShellFileHandleReturnLine(
Status = ShellFileHandleReadLine(Handle, RetVal, &Size, FALSE, Ascii);
}
- if (Status == EFI_END_OF_FILE && *RetVal != CHAR_NULL) {
+ if (Status == EFI_END_OF_FILE && RetVal != NULL && *RetVal != CHAR_NULL) {
Status = EFI_SUCCESS;
}
if (EFI_ERROR(Status) && (RetVal != NULL)) {