]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_open): Ensure
authorVladimir Serbinenko <phcoder@gmail.com>
Fri, 22 Nov 2013 11:00:10 +0000 (12:00 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Fri, 22 Nov 2013 11:00:10 +0000 (12:00 +0100)
at compile time that enough of scratch size is available.

ChangeLog
grub-core/disk/i386/pc/biosdisk.c

index 55fc31858c1dd3aa2cf5c495ea259c245c4f2de5..f9e7a4b6baba3af25233922e6368d10fe1bd887a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-22  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_open): Ensure
+       at compile time that enough of scratch size is available.
+
 2013-11-22  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/kern/x86_64/efi/callwrap.S: Fix stack alignment.
index 7458c7a0f5d842fb069b262ec9e3783728d34eea..1689539cdf578a9e1e617831d3f1f4bd9e4751e5 100644 (file)
@@ -426,6 +426,10 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
   disk->total_sectors = total_sectors;
   /* Limit the max to 0x7f because of Phoenix EDD.  */
   disk->max_agglomerate = 0x7f >> GRUB_DISK_CACHE_BITS;
+  COMPILE_TIME_ASSERT ((0x7f >> GRUB_DISK_CACHE_BITS
+                       << (GRUB_DISK_SECTOR_BITS + GRUB_DISK_CACHE_BITS))
+                      + sizeof (struct grub_biosdisk_dap)
+                      < GRUB_MEMORY_MACHINE_SCRATCH_SIZE);
 
   disk->data = data;