bug-grub
[Top][All Lists]
Advanced

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

Re: [PATCH] avoid NULL deref in grub_device_open


From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: [PATCH] avoid NULL deref in grub_device_open
Date: Thu, 23 Jun 2011 18:09:45 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110606 Iceowl/1.0b2 Icedove/3.1.10

On 11.06.2011 08:54, Jim Meyering wrote:
> I ran coverity against grub.
> Here's a fix for one of the things it spotted:
>
> 2011-06-11  Jim Meyering  <address@hidden>
>
>       avoid NULL deref in grub_device_open
>       * grub-core/kern/device.c (grub_device_open): Don't dereference
>       a NULL pointer upon failed grub_env_get.
>
Applied. Thanks.
> === modified file 'grub-core/kern/device.c'
> --- grub-core/kern/device.c   2010-09-20 19:45:06 +0000
> +++ grub-core/kern/device.c   2011-06-11 06:50:02 +0000
> @@ -35,7 +35,7 @@
>    if (! name)
>      {
>        name = grub_env_get ("root");
> -      if (*name == '\0')
> +      if (name == NULL || *name == '\0')
>       {
>         grub_error (GRUB_ERR_BAD_DEVICE, "no device is set");
>         goto fail;
>
> _______________________________________________
> Bug-grub mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/bug-grub
>


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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