summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit
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/Edit
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/Edit')
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c
index c4dbf80c96..c28f9bc591 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/Edit.c
@@ -36,6 +36,7 @@ ShellCommandRunEdit (
CONST CHAR16 *Cwd;
CHAR16 *Nfs;
CHAR16 *Spot;
+ CONST CHAR16 *TempParam;
// SHELL_FILE_HANDLE TempHandle;
Buffer = NULL;
@@ -101,7 +102,9 @@ ShellCommandRunEdit (
// if editor launched with file named
//
if (ShellCommandLineGetCount(Package) == 2) {
- FileBufferSetFileName (ShellCommandLineGetRawValue(Package, 1));
+ TempParam = ShellCommandLineGetRawValue(Package, 1);
+ ASSERT(TempParam != NULL);
+ FileBufferSetFileName (TempParam);
// if (EFI_ERROR(ShellFileExists(MainEditor.FileBuffer->FileName))) {
// Status = ShellOpenFileByName(MainEditor.FileBuffer->FileName, &TempHandle, EFI_FILE_MODE_CREATE|EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE, 0);
// if (!EFI_ERROR(Status)) {