From f1518f69703e1086f346a6e9d8e5a59855954178 Mon Sep 17 00:00:00 2001 From: jcarsey Date: Thu, 30 Jun 2011 22:25:46 +0000 Subject: add fixes for code verification happyness. signed-off-by: jcarsey reviewed-by: jljusten git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11935 6f19259b-4bc3-4df7-8a09-765794883524 --- ShellPkg/Library/UefiShellLevel1CommandsLib/If.c | 4 ++++ ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c index 1d83f8a246..62c713e589 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/If.c @@ -95,6 +95,10 @@ IsValidProfile ( CONST CHAR16 *TempLocation; ProfilesString = ShellGetEnvironmentVariable(L"profiles"); + // + // According to the Shell spec this is a required environment variable. + // + ASSERT(ProfileString != NULL); TempLocation = StrStr(ProfilesString, String); if ((TempLocation != NULL) && (*(TempLocation-1) == L';') && (*(TempLocation+StrLen(String)) == L';')) { return (TRUE); diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c index d09d2ec7a7..8b30ac3122 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c @@ -254,6 +254,11 @@ ValidateAndCopyFiles( ASSERT(FileList != NULL); ASSERT(DestDir != NULL); + // + // We already verified that this was present. + // + ASSERT(Cwd != NULL); + // // If we are trying to copy multiple files... make sure we got a directory for the target... // -- cgit v1.2.3