* grub-core/partmap/amiga.c (GRUB_AMIGA_PART_MAGIC): New define.

(amiga_partition_map_iterate): Check "PART" magic to avoid a very long
	loop in case of incorrect amiga partmap.
This commit is contained in:
Vladimir 'phcoder' Serbinenko committed 2010-12-31 15:00:45 +01:00
1 parent 307806cb53
commit 275bff5f00
2 files changed
+10

No files matched your search

+4
View File
@@ -44,6 +44,7 @@ struct grub_amiga_partition
{
/* "PART". */
grub_uint8_t magic[4];
#define GRUB_AMIGA_PART_MAGIC "PART"
grub_int32_t size;
grub_int32_t checksum;
grub_uint32_t scsihost;
@@ -110,6 +111,9 @@ amiga_partition_map_iterate (grub_disk_t disk,
if (grub_disk_read (disk, next, 0, sizeof (apart), &apart))
return grub_errno;
if (grub_memcmp (apart.magic, GRUB_AMIGA_PART_MAGIC,
sizeof (apart.magic)) == 0)
/* Calculate the first block and the size of the partition. */
part.start = (grub_be_to_cpu32 (apart.lowcyl)
* grub_be_to_cpu32 (apart.heads)