grub2/0197-grub-core-normal-crypto.c-read_crypto_list-Fix-incor.patch
Peter Jones f74b50e380 Rebase to upstream, fix a pile of bugs. The usual.
Signed-off-by: Peter Jones <pjones@redhat.com>
2013-06-12 15:37:08 -04:00

57 lines
1.6 KiB
Diff

From b3e3387c94fa080342c9dadd32cf83155e4ce85b Mon Sep 17 00:00:00 2001
From: Nickolai Zeldovich <nickolai@csail.mit.edu>
Date: Thu, 7 Mar 2013 08:41:27 +0100
Subject: [PATCH 197/482] * grub-core/normal/crypto.c
(read_crypto_list): Fix incorrect OOM check. *
grub-core/normal/term.c (read_terminal_list): Likewise.
---
ChangeLog | 6 ++++++
grub-core/normal/crypto.c | 2 +-
grub-core/normal/term.c | 2 +-
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 96527dd..ca3d603 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-03-07 Nickolai Zeldovich <nickolai@csail.mit.edu>
+
+ * grub-core/normal/crypto.c (read_crypto_list): Fix incorrect
+ OOM check.
+ * grub-core/normal/term.c (read_terminal_list): Likewise.
+
2013-03-07 Vladimir Serbinenko <phcoder@gmail.com>
Lift up core size limits on some platforms. Fix potential memory
diff --git a/grub-core/normal/crypto.c b/grub-core/normal/crypto.c
index e753dd7..2bfd67c 100644
--- a/grub-core/normal/crypto.c
+++ b/grub-core/normal/crypto.c
@@ -136,7 +136,7 @@ read_crypto_list (const char *prefix)
}
cur->name = grub_strdup (name);
- if (! name)
+ if (! cur->name)
{
grub_errno = GRUB_ERR_NONE;
grub_free (cur);
diff --git a/grub-core/normal/term.c b/grub-core/normal/term.c
index ae91071..f89e5d2 100644
--- a/grub-core/normal/term.c
+++ b/grub-core/normal/term.c
@@ -389,7 +389,7 @@ read_terminal_list (const char *prefix)
}
cur->name = grub_strdup (name);
- if (! name)
+ if (! cur->name)
{
grub_errno = GRUB_ERR_NONE;
grub_free (cur);
--
1.8.2.1