From: Vladimir 'phcoder' Serbinenko Date: Fri, 23 Dec 2011 12:38:21 +0000 (+0100) Subject: * grub-core/fs/cpio.c (grub_cpio_find_file): Fix handling of names X-Git-Tag: 2.00~839 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a54a0e1270a06a780259f2fdf2c90de12f73d5ce;p=thirdparty%2Fgrub.git * grub-core/fs/cpio.c (grub_cpio_find_file): Fix handling of names occupying the whole field size. --- diff --git a/ChangeLog b/ChangeLog index 979acdf47..de2ec0406 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-12-23 Vladimir Serbinenko + + * grub-core/fs/cpio.c (grub_cpio_find_file): Fix handling of names + occupying the whole field size. + 2011-12-23 Lukas Anzinger * util/grub-mkconfig_lib.in (version_test_gt): Fix variable names. diff --git a/grub-core/fs/cpio.c b/grub-core/fs/cpio.c index 63a1d1f43..a40d4f0a2 100644 --- a/grub-core/fs/cpio.c +++ b/grub-core/fs/cpio.c @@ -225,7 +225,7 @@ grub_cpio_find_file (struct grub_cpio_data *data, char **name, if (!have_longname) { - *name = grub_strdup (hd.name); + *name = grub_strndup (hd.name, sizeof (hd.name)); if (*name == NULL) return grub_errno; }