From 8a3bc88ea740221ae56afdd1545327f45280f112 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 11 Apr 2011 07:41:59 +0200 Subject: [PATCH] * util/grub-fstest.c (cmd_cmp): Check that sizes match. --- ChangeLog | 4 ++++ util/grub-fstest.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index cbb77c14c..dbcbb9651 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-04-11 Vladimir Serbinenko + + * util/grub-fstest.c (cmd_cmp): Check that sizes match. + 2011-04-11 Vladimir Serbinenko * util/grub-fstest.c (read_file): Report GRUB error if file opening diff --git a/util/grub-fstest.c b/util/grub-fstest.c index 51c1a3a52..293bdf74a 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -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); }