fix two out-of-memory checks
PATCH 1/1 fix two out-of-memory checks
read_terminal_list() and read_crypto_list() both call
cur->name = grub_strdup (name);
and both incorrectly check whether it failed by using "if (!name)" instead of "if (!cur->name)". The patch below fixes these two issues.
Nickolai.
---
normal/crypto.c +1 -1
@@ -136,7 +136,7 @@ } cur->name =grub_strdup (name); -if (! name) +if (! cur->name) { grub_errno =GRUB_ERR_NONE ;grub_free (cur);
normal/term.c +1 -1
@@ -389,7 +389,7 @@ } cur->name =grub_strdup (name); -if (! name) +if (! cur->name) { grub_errno =GRUB_ERR_NONE ;grub_free (cur);
Quoted 7 lines · Nickolai Zeldovich
read_terminal_list()andread_crypto_list()both callcur->name = grub_strdup (name);and both incorrectly check whether it failed by using "if (!name)" instead of "if (!cur->name)". The patch below fixes these two issues.
Applied thanks. Your patch was garbled though. Please send as text attachement next time.
Quoted 34 lines
Nickolai.
---
normal/crypto.c 2013-03-04 03:46:35 +0000 renamed from normal/crypto.c 2012-03-11 13:43:18 +0000 +1
-1@@ -136,7 +136,7 @@ } cur->name = grub_strdup (name); - if (! name) + if (! cur->name) { grub_errno = GRUB_ERR_NONE; grub_free (cur);normal/term.c 2013-03-04 03:46:23 +0000 renamed from normal/term.c 2013-03-02 10:47:59 +0000 +1
-1@@ -389,7 +389,7 @@ } cur->name = grub_strdup (name); - if (! name) + if (! cur->name) { grub_errno = GRUB_ERR_NONE; grub_free (cur);_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel