summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-10 20:32:17 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-10-10 20:32:17 +0000
commitecae51177e83db0d99f8b4888ae4b866c18651b6 (patch)
tree61522e5d6294adbafeb58f35e61b090358c5126d /ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c
parentbeab0fc5e2ea7c676968991b1ae8e1fc72aef19f (diff)
downloadedk2-platforms-ecae51177e83db0d99f8b4888ae4b866c18651b6.tar.xz
ShellPkg: Add checks for NULL pointers.
This adds lots of pointer verification with ASSERTs only used when the condition should be impossible and never for memory allocation. signed-off-by: jcarsey reviewed-by: geekboy15a git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12523 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c')
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c
index d4bb6217b0..25e8718980 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/EfiCompress.c
@@ -42,6 +42,7 @@ ShellCommandRunEfiCompress (
VOID *InBuffer;
CHAR16 *InFileName;
CONST CHAR16 *OutFileName;
+ CONST CHAR16 *TempParam;
InFileName = NULL;
OutFileName = NULL;
@@ -82,10 +83,12 @@ ShellCommandRunEfiCompress (
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellDebug1HiiHandle);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
- InFileName = ShellFindFilePath(ShellCommandLineGetRawValue(Package, 1));
+ TempParam = ShellCommandLineGetRawValue(Package, 1);
+ ASSERT(TempParam != NULL);
+ InFileName = ShellFindFilePath(TempParam);
OutFileName = ShellCommandLineGetRawValue(Package, 2);
if (InFileName == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, ShellCommandLineGetRawValue(Package, 1));
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_FILE_FIND_FAIL), gShellDebug1HiiHandle, TempParam);
ShellStatus = SHELL_NOT_FOUND;
} else {
if (ShellIsDirectory(InFileName) == EFI_SUCCESS){