]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-01-05 Colin Watson <cjwatson@ubuntu.com>
authorColin Watson <cjwatson@ubuntu.com>
Tue, 5 Jan 2010 12:40:30 +0000 (12:40 +0000)
committerColin Watson <cjwatson@ubuntu.com>
Tue, 5 Jan 2010 12:40:30 +0000 (12:40 +0000)
* util/mkisofs/write.c (padblock_write): Check return value of
fread.

ChangeLog
util/mkisofs/write.c

index d9d327bace4544d560afff8516d11abba7d481d0..061fadc180d718bfb7e6de464edb392867e70ee3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-05  Colin Watson  <cjwatson@ubuntu.com>
+
+       * util/mkisofs/write.c (padblock_write): Check return value of
+       fread.
+
 2010-01-05  Robert Millan  <rmh.grub@aybabtu.com>
 
        Remove grub-mkfloppy.  Images produced by grub-mkrescue are valid
index 896e2833bb56d160960be9d1c89d8879d5dfe15c..d9b1fd05d859546cc78cf978aca7dc3d78001a0a 100644 (file)
@@ -1437,7 +1437,9 @@ static int FDECL1(padblock_write, FILE *, outfile)
       if (! fp)
        error (1, errno, _("Unable to open %s"), boot_image_embed);
 
-      fread (buffer, 2048 * PADBLOCK_SIZE, 1, fp);
+      if (fread (buffer, 2048 * PADBLOCK_SIZE, 1, fp) == 0)
+       error (1, errno, _("cannot read %llu bytes from %s"),
+              (size_t) (2048 * PADBLOCK_SIZE), boot_image_embed);
       if (fgetc (fp) != EOF)
        error (1, 0, _("%s is too big for embed area"), boot_image_embed);
     }