summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-10 17:26:25 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-10 17:26:25 +0000
commitbeab0fc5e2ea7c676968991b1ae8e1fc72aef19f (patch)
tree98408a7c86ab39da411175a2e5ab30d5b04f7377 /ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c
parent091bb7138b9b7b18e32f13d415e8fc5f518de8fc (diff)
downloadedk2-platforms-beab0fc5e2ea7c676968991b1ae8e1fc72aef19f.tar.xz
ShellPkg: Verify memory allocations without ASSERT.
signed-off-by: jcarsey reviewed-by: geekboy15a git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12522 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c')
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c
index 44e83ba254..aa40bbf22f 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c
@@ -179,6 +179,7 @@ ShellCommandRunDate (
EFI_TIME TheTime;
CHAR16 *ProblemParam;
SHELL_STATUS ShellStatus;
+ CONST CHAR16 *Param1;
ShellStatus = SHELL_SUCCESS;
ProblemParam = NULL;
@@ -238,9 +239,14 @@ ShellCommandRunDate (
//
// perform level 3 operation here.
//
- ShellStatus = CheckAndSetDate(ShellCommandLineGetRawValue(Package, 1));
+ Param1 = ShellCommandLineGetRawValue(Package, 1);
+ if (Param1 == NULL) {
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ } else {
+ ShellStatus = CheckAndSetDate(Param1);
+ }
if (ShellStatus != SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, 1));
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, Param1);
ShellStatus = SHELL_INVALID_PARAMETER;
}
}