grub2/0336-grub-core-kern-dl.c-grub_dl_resolve_symbols-Handle-m.patch
2013-06-07 14:03:56 -04:00

42 lines
1.3 KiB
Diff

From b6e147adfbeadc1f9b581e9d0124d72a7c488f60 Mon Sep 17 00:00:00 2001
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Date: Wed, 24 Apr 2013 13:58:31 +0200
Subject: [PATCH 336/471] * grub-core/kern/dl.c
(grub_dl_resolve_symbols): Handle malloc failure.
---
ChangeLog | 4 ++++
grub-core/kern/dl.c | 2 ++
2 files changed, 6 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 39bb827..598d16c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
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
in belief that RAM on SGI platforms grows down while in fact it
grows up from an unusual base.
diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c
index d06b6ae..c6d9ec9 100644
--- a/grub-core/kern/dl.c
+++ b/grub-core/kern/dl.c
@@ -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);
--
1.8.2.1