]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix a bug that BCFG creates Key#### variable bigger than it should be.
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 18 Oct 2012 07:32:42 +0000 (07:32 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 18 Oct 2012 07:32:42 +0000 (07:32 +0000)
Signed-off-by: Ruiyu Ni<ruiyu.ni@intel.com>
Reviewed-by: Eric Dong<eric.dong@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13862 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c

index 22f6c6f618cb46dc3d548aa721fd61b571ce611b..a7a10bf3bba63cb725708565ab652f862ff13c10 100644 (file)
@@ -857,7 +857,7 @@ BcfgAddOptInstall1(
         // 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_KEY_DATA) * KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption)), &NewKeyOption);\r
+        KeyOptionBuffer = AllocateCopyPool(sizeof(EFI_KEY_OPTION) + (sizeof(EFI_INPUT_KEY) * KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption)), &NewKeyOption);\r
         if (KeyOptionBuffer == NULL) {\r
           ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellInstall1HiiHandle);\r
           ShellStatus = SHELL_OUT_OF_RESOURCES;\r
@@ -929,7 +929,7 @@ BcfgAddOptInstall1(
           VariableName,\r
           (EFI_GUID*)&gEfiGlobalVariableGuid,\r
           EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,\r
-          sizeof(EFI_KEY_OPTION) + (sizeof(EFI_KEY_DATA) * KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption)),\r
+          sizeof(EFI_KEY_OPTION) + (sizeof(EFI_INPUT_KEY) * KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption)),\r
           KeyOptionBuffer);\r
         if (EFI_ERROR(Status)) {\r
           ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellInstall1HiiHandle, VariableName, Status);\r