summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellLib/UefiShellLib.c
diff options
context:
space:
mode:
authorQiu Shumin <shumin.qiu@intel.com>2016-02-22 10:21:38 +0800
committerQiu Shumin <shumin.qiu@intel.com>2016-02-23 10:44:36 +0800
commite3b76f3b5e80df1219fb4adf0199b9606e84b8e7 (patch)
treea6a302bf38386656e159e46cac1236050672c20d /ShellPkg/Library/UefiShellLib/UefiShellLib.c
parente1695f8dcf18f612d34f6da0a4579a5b7c49ef9b (diff)
downloadedk2-e3b76f3b5e80df1219fb4adf0199b9606e84b8e7.tar.gz
edk2-e3b76f3b5e80df1219fb4adf0199b9606e84b8e7.tar.bz2
edk2-e3b76f3b5e80df1219fb4adf0199b9606e84b8e7.zip
ShellPkg: Do NULL pointer check before the pointer is used.
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>
Diffstat (limited to 'ShellPkg/Library/UefiShellLib/UefiShellLib.c')
-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)) {