summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c')
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c
index 99cc448..a33343d 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SerMode.c
@@ -288,7 +288,13 @@ ShellCommandRunSerMode (
goto Done;
}
- Temp = ShellCommandLineGetRawValue (Package, 5);
+ Temp = ShellCommandLineGetRawValue (Package, 5);
+ if (Temp == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"sermode");
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ goto Done;
+ }
+
Value = ShellStrToUintn (Temp);
switch (Value) {
case 0: