]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-fstest.c (cmd_cmp): Check that sizes match.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 11 Apr 2011 05:41:59 +0000 (07:41 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 11 Apr 2011 05:41:59 +0000 (07:41 +0200)
ChangeLog
util/grub-fstest.c

index cbb77c14c45a592933ccd9b0b15c256bee1c4efe..dbcbb96519d3b7bca86fda0f9aa15d8988904a44 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-04-11  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * util/grub-fstest.c (cmd_cmp): Check that sizes match.
+
 2011-04-11  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * util/grub-fstest.c (read_file): Report GRUB error if file opening
index 51c1a3a52a79132a210881277b884b3fe680e986..293bdf74a5885c50372c7d2dba5a419fbca7fe93 100644 (file)
@@ -222,6 +222,14 @@ cmd_cmp (char *src, char *dest)
     grub_util_error (_("seek error"));
 
   read_file (src, cmp_hook);
+
+  {
+    grub_uint64_t pre;
+    pre = ftell (ff);
+    fseek (ff, 0, SEEK_END);
+    if (pre != ftell (ff))
+      grub_util_error (_("unexpected end of file"));
+  }
   fclose (ff);
 }