Blob Blame History Raw
From 412f61e8c25bfde5526d86bc2db1988e4c403e1d 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 196/364] 	* 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.1.4