//\r
// now do the replacements...\r
//\r
- NewCommandLine1 = AllocateCopyPool(NewSize, OriginalCommandLine);\r
+ NewCommandLine1 = AllocateZeroPool (NewSize);\r
NewCommandLine2 = AllocateZeroPool(NewSize);\r
ItemTemp = AllocateZeroPool(ItemSize+(2*sizeof(CHAR16)));\r
if (NewCommandLine1 == NULL || NewCommandLine2 == NULL || ItemTemp == NULL) {\r
SHELL_FREE_NON_NULL(ItemTemp);\r
return (NULL);\r
}\r
+ CopyMem (NewCommandLine1, OriginalCommandLine, StrSize (OriginalCommandLine));\r
+\r
for (MasterEnvList = EfiShellGetEnv(NULL)\r
; MasterEnvList != NULL && *MasterEnvList != CHAR_NULL\r
; MasterEnvList += StrLen(MasterEnvList) + 1\r
OriginalOptionDataSize += (*(UINT16*)(OriginalData + sizeof(UINT32)));\r
OriginalOptionDataSize -= OriginalSize;\r
NewSize = OriginalSize - OriginalOptionDataSize + DataSize;\r
- NewData = AllocateCopyPool(NewSize, OriginalData);\r
+ NewData = AllocatePool(NewSize);\r
if (NewData == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
} else {\r
+ CopyMem (NewData, OriginalData, OriginalSize - OriginalOptionDataSize);\r
CopyMem(NewData + OriginalSize - OriginalOptionDataSize, Data, DataSize);\r
}\r
}\r
// Now we know how many EFI_INPUT_KEY structs we need to attach to the end of the EFI_KEY_OPTION struct. \r
// Re-allocate with the added information.\r
//\r
- KeyOptionBuffer = AllocateCopyPool(sizeof(EFI_KEY_OPTION) + (sizeof(EFI_INPUT_KEY) * NewKeyOption.KeyData.Options.InputKeyCount), &NewKeyOption);\r
+ KeyOptionBuffer = AllocatePool (sizeof(EFI_KEY_OPTION) + (sizeof(EFI_INPUT_KEY) * NewKeyOption.KeyData.Options.InputKeyCount));\r
if (KeyOptionBuffer == NULL) {\r
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellBcfgHiiHandle, L"bcfg"); \r
ShellStatus = SHELL_OUT_OF_RESOURCES;\r
+ return ShellStatus;\r
}\r
+ CopyMem (KeyOptionBuffer, &NewKeyOption, sizeof(EFI_KEY_OPTION));\r
}\r
for (LoopCounter = 0 ; ShellStatus == SHELL_SUCCESS && LoopCounter < NewKeyOption.KeyData.Options.InputKeyCount; LoopCounter++) {\r
//\r