From c338c54a127656ef0f750d78bad6371874a98ca8 Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phco...@gmail.com>
Date: Sun, 13 Aug 2023 09:18:53 +0200
Subject: [PATCH 4/4] gpt: Add compile time asserts for guid and gpt_partentry
 sizes

Signed-off-by: Vladimir Serbinenko <phco...@gmail.com>
---
 grub-core/partmap/gpt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/grub-core/partmap/gpt.c b/grub-core/partmap/gpt.c
index 877ceefc3..426f616ae 100644
--- a/grub-core/partmap/gpt.c
+++ b/grub-core/partmap/gpt.c
@@ -229,6 +229,9 @@ static struct grub_partition_map grub_gpt_partition_map =
 
 GRUB_MOD_INIT(part_gpt)
 {
+  COMPILE_TIME_ASSERT(sizeof(grub_guid_t) == 16);
+  COMPILE_TIME_ASSERT(sizeof(grub_packed_guid_t) == 16);
+  COMPILE_TIME_ASSERT(sizeof(struct grub_gpt_partentry) == 128);
   grub_partition_map_register (&grub_gpt_partition_map);
 }
 
-- 
2.39.2

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to