* grub-core/font/font_cmd.c (loadfont_command): Set grub_errno

on error if not already done.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-05-14 22:29:27 +02:00
parent 25a4533875
commit b25db21885
2 changed files with 13 additions and 1 deletions

View file

@ -1,9 +1,17 @@
2011-05-14 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/font/font_cmd.c (loadfont_command): Set grub_errno
on error if not already done.
2011-05-14 Vladimir Serbinenko <phcoder@gmail.com>
Fix few potential memory misusage.
* grub-core/font/font.c (load_font_index): Don't free char_index to
avoid double free.
(grub_font_load): Zero-fill font at alloc for safety.
Close file on error.
(free_font): Free bmp_idx.
2011-05-14 Vladimir Serbinenko <phcoder@gmail.com>

View file

@ -33,7 +33,11 @@ loadfont_command (grub_command_t cmd __attribute__ ((unused)),
while (argc--)
if (grub_font_load (*args++) != 0)
return GRUB_ERR_BAD_FONT;
{
if (!grub_errno)
return grub_error (GRUB_ERR_BAD_FONT, "invalid font");
return grub_errno;
}
return GRUB_ERR_NONE;
}