* grub-core/fs/cpio.c (grub_cpio_find_file): Fix handling of names

occupying the whole field size.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-12-23 13:38:21 +01:00
parent a6120aca2e
commit a54a0e1270
2 changed files with 6 additions and 1 deletions

View file

@ -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;
}