summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Universal
diff options
context:
space:
mode:
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2007-02-28 06:22:43 +0000
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2007-02-28 06:22:43 +0000
commit2c33bcb4f2bfe2e85d4f6b246b26c96cf971c318 (patch)
tree960a4a4d90404b2df5e58bd2091c6f988432d807 /EdkModulePkg/Universal
parent5d09d1b775b203c349ae629cea796e224d71d212 (diff)
downloadedk2-platforms-2c33bcb4f2bfe2e85d4f6b246b26c96cf971c318.tar.xz
Add range checking of partition for MBR.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2409 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Universal')
-rw-r--r--EdkModulePkg/Universal/Disk/Partition/Dxe/Mbr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/EdkModulePkg/Universal/Disk/Partition/Dxe/Mbr.c b/EdkModulePkg/Universal/Disk/Partition/Dxe/Mbr.c
index 8dd0b4b497..f1b1de0d64 100644
--- a/EdkModulePkg/Universal/Disk/Partition/Dxe/Mbr.c
+++ b/EdkModulePkg/Universal/Disk/Partition/Dxe/Mbr.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2006, Intel Corporation
+Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -276,8 +276,8 @@ Returns:
HdDev.PartitionNumber = PartitionNumber ++;
HdDev.PartitionStart = UNPACK_UINT32 (Mbr->Partition[0].StartingLBA) + ExtMbrStartingLba + ParentHdDev.PartitionStart;
HdDev.PartitionSize = UNPACK_UINT32 (Mbr->Partition[0].SizeInLBA);
- if (HdDev.PartitionStart + HdDev.PartitionSize - 1 >=
- ParentHdDev.PartitionStart + ParentHdDev.PartitionSize) {
+ if ((HdDev.PartitionStart + HdDev.PartitionSize - 1 >= ParentHdDev.PartitionStart + ParentHdDev.PartitionSize) ||
+ (HdDev.PartitionStart <= ParentHdDev.PartitionStart)) {
break;
}