From 863210e7b05f5edbe16fbb2ef8c8c6191a301da3 Mon Sep 17 00:00:00 2001 From: Qiu Shumin Date: Mon, 22 Feb 2016 10:21:38 +0800 Subject: 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 Reviewed-by: Jaben Carsey (cherry picked from commit e3b76f3b5e80df1219fb4adf0199b9606e84b8e7) --- ShellPkg/Library/UefiShellLib/UefiShellLib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ShellPkg/Library/UefiShellLib') 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)) { -- cgit v1.2.3