[Parted-commits] GNU Parted Official Repository: Changes to 'master'

Jim Meyering meyering at alioth.debian.org
Mon Oct 19 14:57:27 UTC 2009


 libparted/labels/gpt.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit d327399a1f5d148dc785fea19613209c93d0ecde
Author: Jim Meyering <meyering at redhat.com>
Date:   Mon Oct 19 16:56:21 2009 +0200

    gpt: add a comment
    
    * libparted/labels/gpt.c (_header_is_valid): Add a comment to explain
    the new partition entry size limitation of UINT32_MAX/16.

diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index 7fa70d5..5234a17 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -604,10 +604,10 @@ _header_is_valid (const PedDevice* dev, GuidPartitionTableHeader_t* gpt)
 	    || PED_LE32_TO_CPU (gpt->HeaderSize) > dev->sector_size)
 		return 0;
 
-	/*
-	 * the SizeOfPartitionEntry must be a multiple of 8 and
-	 * no smaller than the size of the PartitionEntry structure.
-	 */
+	/* The SizeOfPartitionEntry must be a multiple of 8 and
+	   no smaller than the size of the PartitionEntry structure.
+	   We also require that be no larger than 1/16th of UINT32_MAX,
+	   as an additional sanity check.  */
 	uint32_t sope = PED_LE32_TO_CPU (gpt->SizeOfPartitionEntry);
 	if (sope % 8 != 0
             || sope < sizeof (GuidPartitionEntry_t)



More information about the Parted-commits mailing list