From a54a0e1270a06a780259f2fdf2c90de12f73d5ce Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 23 Dec 2011 13:38:21 +0100 Subject: [PATCH] * grub-core/fs/cpio.c (grub_cpio_find_file): Fix handling of names occupying the whole field size. --- ChangeLog | 5 +++++ grub-core/fs/cpio.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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; }