grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] fix two out-of-memory checks


From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: [PATCH] fix two out-of-memory checks
Date: Thu, 07 Mar 2013 08:42:13 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

On 04.03.2013 05:07, Nickolai Zeldovich wrote:

> 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.
> 

Applied thanks. Your patch was garbled though. Please send as text
attachement next time.

> Nickolai.
> 
> ---
> 
> --- grub-core/normal/crypto.c    2012-03-11 13:43:18 +0000
> +++ grub-core/normal/crypto.c    2013-03-04 03:46:35 +0000
> @@ -136,7 +136,7 @@
>      }
> 
>        cur->name = grub_strdup (name);
> -      if (! name)
> +      if (! cur->name)
>      {
>        grub_errno = GRUB_ERR_NONE;
>        grub_free (cur);
> 
> --- grub-core/normal/term.c    2013-03-02 10:47:59 +0000
> +++ grub-core/normal/term.c    2013-03-04 03:46:23 +0000
> @@ -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
> address@hidden
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 



Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]