From 9127a094fd2214da6af972a1e322a04b9e16222d Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Fri, 25 Jan 2013 11:50:59 +0000 Subject: [PATCH 1/1] ArmPlatformPkg/Bds: Fixed the deletion of boot option entries When deleting a boot entry from the boot menu all next entries must be copied one entry up to rearrange the BootOrder list. This patch fixes the copy: each boot entry is 16 bits, not 8 bits. Signed-off-by: Olivier Martin git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14090 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Bds/BootOption.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ArmPlatformPkg/Bds/BootOption.c b/ArmPlatformPkg/Bds/BootOption.c index 289d36a50b..e562add3d1 100644 --- a/ArmPlatformPkg/Bds/BootOption.c +++ b/ArmPlatformPkg/Bds/BootOption.c @@ -1,6 +1,6 @@ /** @file * -* Copyright (c) 2011-2012, ARM Limited. All rights reserved. +* Copyright (c) 2011-2013, ARM Limited. All rights reserved. * * This program and the accompanying materials * are licensed and made available under the terms and conditions of the BSD License @@ -367,7 +367,11 @@ BootOptionDelete ( if (BootOrder[Index] == BootOption->LoadOptionIndex) { // If it the last entry we do not need to rearrange the BootOrder list if (Index + 1 != BootOrderCount) { - CopyMem (&BootOrder[Index],&BootOrder[Index+1], BootOrderCount - (Index + 1)); + CopyMem ( + &BootOrder[Index], + &BootOrder[Index + 1], + (BootOrderCount - (Index + 1)) * sizeof(UINT16) + ); } break; } -- 2.39.2