commit-grub
[Top][All Lists]
Advanced

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

[1888] 2008-10-29 Guillem Jover <address@hidden>


From: Robert Millan
Subject: [1888] 2008-10-29 Guillem Jover <address@hidden>
Date: Wed, 29 Oct 2008 19:22:15 +0000

Revision: 1888
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=1888
Author:   robertmh
Date:     2008-10-29 19:22:13 +0000 (Wed, 29 Oct 2008)

Log Message:
-----------
2008-10-29  Guillem Jover <address@hidden>

        * disk/lvm.c (grub_lvm_scan_device): Fix possible NULL value handling
        (add a missing NULL check, and correct them by moving the pointer
        operations after the actual check).

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/disk/lvm.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog       2008-10-29 19:14:12 UTC (rev 1887)
+++ trunk/grub2/ChangeLog       2008-10-29 19:22:13 UTC (rev 1888)
@@ -1,3 +1,9 @@
+2008-10-29  Guillem Jover <address@hidden>
+
+       * disk/lvm.c (grub_lvm_scan_device): Fix possible NULL value handling
+       (add a missing NULL check, and correct them by moving the pointer
+       operations after the actual check).
+
 2008-10-29  Robert Millan  <address@hidden>
 
        * util/i386/pc/grub-install.in: Handle empty string as output from

Modified: trunk/grub2/disk/lvm.c
===================================================================
--- trunk/grub2/disk/lvm.c      2008-10-29 19:14:12 UTC (rev 1887)
+++ trunk/grub2/disk/lvm.c      2008-10-29 19:22:13 UTC (rev 1888)
@@ -384,9 +384,10 @@
              grub_memcpy (pv->name, p, s);
              pv->name[s] = '\0';
              
-             p = grub_strstr (p, "id = \"") + sizeof("id = \"") - 1;
+             p = grub_strstr (p, "id = \"");
              if (p == NULL)
                goto pvs_fail;
+             p += sizeof("id = \"") - 1;
              
              grub_memcpy (pv->id, p, GRUB_LVM_ID_STRLEN);
              pv->id[GRUB_LVM_ID_STRLEN] = '\0';
@@ -398,7 +399,10 @@
              pv->next = vg->pvs;
              vg->pvs = pv;
              
-             p = grub_strchr (p, '}') + 1;
+             p = grub_strchr (p, '}');
+             if (p == NULL)
+               goto pvs_fail;
+             p++;
              
              continue;
            pvs_fail:






reply via email to

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