summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellLib
diff options
context:
space:
mode:
authorQiu Shumin <shumin.qiu@intel.com>2016-02-22 10:21:38 +0800
committerHao Wu <hao.a.wu@intel.com>2016-07-13 20:42:04 +0800
commit863210e7b05f5edbe16fbb2ef8c8c6191a301da3 (patch)
tree5c6792d9004f8bb56715503fc96ce7f455412021 /ShellPkg/Library/UefiShellLib
parent552057436657ab09df3306ad272930a9fa029fa8 (diff)
downloadedk2-platforms-863210e7b05f5edbe16fbb2ef8c8c6191a301da3.tar.xz
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> (cherry picked from commit e3b76f3b5e80df1219fb4adf0199b9606e84b8e7)
Diffstat (limited to 'ShellPkg/Library/UefiShellLib')
-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)) {