]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Bds/BootOption.c
ArmPlatformPkg/Bds: Fixed the deletion of boot option entries
[mirror_edk2.git] / ArmPlatformPkg / Bds / BootOption.c
index 289d36a50badb9f44726380a96b53953a9961993..e562add3d1ab8f084ad0ed0d60d713765de48402 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 *\r
-*  Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
 *\r
 *  This program and the accompanying materials\r
 *  are licensed and made available under the terms and conditions of the BSD License\r
@@ -367,7 +367,11 @@ BootOptionDelete (
       if (BootOrder[Index] == BootOption->LoadOptionIndex) {\r
         // If it the last entry we do not need to rearrange the BootOrder list\r
         if (Index + 1 != BootOrderCount) {\r
-          CopyMem (&BootOrder[Index],&BootOrder[Index+1], BootOrderCount - (Index + 1));\r
+          CopyMem (\r
+            &BootOrder[Index],\r
+            &BootOrder[Index + 1],\r
+            (BootOrderCount - (Index + 1)) * sizeof(UINT16)\r
+            );\r
         }\r
         break;\r
       }\r