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
This commit is contained in:
xli24 2007-02-28 06:22:43 +00:00
parent 5d09d1b775
commit 2c33bcb4f2
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}