Comment's added and fixed.
Pointer's checked for NULL before access and after memory allocations. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11499 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -33,6 +33,7 @@ ShellCommandRunGoto (
|
||||
SHELL_STATUS ShellStatus;
|
||||
CHAR16 *CompareString;
|
||||
UINTN Size;
|
||||
SCRIPT_FILE *CurrentScriptFile;
|
||||
|
||||
ShellStatus = SHELL_SUCCESS;
|
||||
CompareString = NULL;
|
||||
@ -79,6 +80,7 @@ ShellCommandRunGoto (
|
||||
// Check forwards and then backwards for a label...
|
||||
//
|
||||
if (!MoveToTag(GetNextNode, L"endfor", L"for", CompareString, ShellCommandGetCurrentScriptFile(), FALSE, FALSE, TRUE)) {
|
||||
CurrentScriptFile = ShellCommandGetCurrentScriptFile();
|
||||
ShellPrintHiiEx(
|
||||
-1,
|
||||
-1,
|
||||
@ -87,9 +89,9 @@ ShellCommandRunGoto (
|
||||
gShellLevel1HiiHandle,
|
||||
CompareString,
|
||||
L"Goto",
|
||||
ShellCommandGetCurrentScriptFile()!=NULL
|
||||
&&ShellCommandGetCurrentScriptFile()->CurrentCommand!=NULL
|
||||
?ShellCommandGetCurrentScriptFile()->CurrentCommand->Line:0);
|
||||
CurrentScriptFile!=NULL
|
||||
&& CurrentScriptFile->CurrentCommand!=NULL
|
||||
? CurrentScriptFile->CurrentCommand->Line:0);
|
||||
ShellStatus = SHELL_NOT_FOUND;
|
||||
}
|
||||
FreePool(CompareString);
|
||||
|
Reference in New Issue
Block a user