summaryrefslogtreecommitdiff
path: root/ShellPkg/Application/Shell/ShellManParser.c
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Application/Shell/ShellManParser.c')
-rw-r--r--ShellPkg/Application/Shell/ShellManParser.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ShellPkg/Application/Shell/ShellManParser.c b/ShellPkg/Application/Shell/ShellManParser.c
index bcc1f8e0a3..bd2efcb423 100644
--- a/ShellPkg/Application/Shell/ShellManParser.c
+++ b/ShellPkg/Application/Shell/ShellManParser.c
@@ -548,7 +548,8 @@ ManFileFindTitleSection(
@retval EFI_SUCCESS The help text was returned.
@retval EFI_OUT_OF_RESOURCES The necessary buffer could not be allocated to hold the
returned help text.
- @retval EFI_INVALID_PARAMETER HelpText is NULL
+ @retval EFI_INVALID_PARAMETER HelpText is NULL.
+ @retval EFI_INVALID_PARAMETER ManFileName is invalid.
@retval EFI_NOT_FOUND There is no help text available for Command.
**/
EFI_STATUS
@@ -594,6 +595,9 @@ ProcessManFile(
} else {
FileHandle = NULL;
TempString = GetManFileName(ManFileName);
+ if (TempString == NULL) {
+ return (EFI_INVALID_PARAMETER);
+ }
Status = SearchPathForFile(TempString, &FileHandle);
if (EFI_ERROR(Status)) {