]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c
smbiosview - add user input verification.
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / SmbiosView / SmbiosView.c
index a45a721df320215adf469c57cfddcd22ad399316..b59109c455b2aedc755c773c4f2578c49cb56557 100644 (file)
@@ -65,6 +65,12 @@ ShellCommandRunSmbiosView (
     if (ShellCommandLineGetCount(Package) > 1) {\r
       ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);\r
       ShellStatus = SHELL_INVALID_PARAMETER;\r
+    } else if (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetValue(Package, L"-t") == NULL) {\r
+      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"-t");\r
+      ShellStatus = SHELL_INVALID_PARAMETER;\r
+    } else if (ShellCommandLineGetFlag(Package, L"-h") && ShellCommandLineGetValue(Package, L"-h") == NULL) {\r
+      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"-h");\r
+      ShellStatus = SHELL_INVALID_PARAMETER;\r
     } else if (\r
         (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetFlag(Package, L"-h")) ||\r
         (ShellCommandLineGetFlag(Package, L"-t") && ShellCommandLineGetFlag(Package, L"-s")) ||\r