]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c
Fix a bug that BCFG creates Key#### variable bigger than it should be.
[mirror_edk2.git] / 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