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>
This commit is contained in:
@ -4071,7 +4071,7 @@ ShellFileHandleReturnLine(
|
|||||||
Status = ShellFileHandleReadLine(Handle, RetVal, &Size, FALSE, Ascii);
|
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;
|
Status = EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
if (EFI_ERROR(Status) && (RetVal != NULL)) {
|
if (EFI_ERROR(Status) && (RetVal != NULL)) {
|
||||||
|
Reference in New Issue
Block a user