* grub-core/kern/dl.c (grub_dl_resolve_symbols): Handle malloc failure.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-04-24 13:58:31 +02:00
parent 8528c879e3
commit cdeb832472
2 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2013-04-24 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/dl.c (grub_dl_resolve_symbols): Handle malloc failure.
2013-04-24 Vladimir Serbinenko <phcoder@gmail.com>
Move mips-arc link address. Previous link address was chosen

View File

@ -359,6 +359,8 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e)
#ifdef GRUB_MODULES_MACHINE_READONLY
mod->symtab = grub_malloc (s->sh_size);
if (!mod->symtab)
return grub_errno;
memcpy (mod->symtab, (char *) e + s->sh_offset, s->sh_size);
#else
mod->symtab = (Elf_Sym *) ((char *) e + s->sh_offset);