]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix segfault if storage pool has no type attribute (possibly others)
authorCole Robinson <crobinso@redhat.com>
Mon, 22 Jun 2009 16:37:52 +0000 (16:37 +0000)
committerCole Robinson <crobinso@redhat.com>
Mon, 22 Jun 2009 16:37:52 +0000 (16:37 +0000)
virEnumFromString doesn't check for a NULL string, and will segfault if
passed one. Lots of calling code protects against this, but at least
/pool/@type parsing does not.

ChangeLog
src/util.c

index e462c5e233c4b0f262477193cba5001dff7ef2b8..f8c157a8f0939efea873801e807e099c18c53ec8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,23 +1,18 @@
+Mon Jun 22 12:35:34 EDT 2009 Cole Robinson <crobinso@redhat.com>
+
+       * src/util.c: Fix segfault if storage pool has no type attribute
+       (possibly others)
+
 Mon Jun 22 12:33:37 EDT 2009 Cole Robinson <crobinso@redhat.com>
 
        * src/qemu_driver.c: Fix memory reporting for inactive domains
        in the qemu driver.
 
-Currently, 'info' will always report that mem = max mem. Make sure we
-actually return the correct mem value.
-
 Mon Jun 22 12:31:38 EDT 2009 Cole Robinson <crobinso@redhat.com>
 
        * src/storage_backend_fs.c src/storage_driver.c:
        Fix raw storage volume creation for allocation < capacity.
 
-CreateXMLFrom changes accidentally caused all raw volume creation to be
-fully allocated (as though allocation == capacity). Fix this.
-
-Also force CreateXMLFrom to maintain the previous behavior: sparseness
-should still be maintained since we search for holes when copying, and the
-clone behavior hasn't been tested with anything but the broken behavior.
-
 Mon Jun 22 11:09:18 EDT 2009 Cole Robinson <crobinso@redhat.com>
 
        * src/test.c: Fix domain ID after redefining a running VM
index d8ab37f7e4eae4ab9798199f1359db4cb3d25a0b..8b746f5ae720bb3338d42e3eaf86372c22d30d14 100644 (file)
@@ -1622,6 +1622,9 @@ int virEnumFromString(const char *const*types,
                       const char *type)
 {
     unsigned int i;
+    if (!type)
+        return -1;
+
     for (i = 0 ; i < ntypes ; i++)
         if (STREQ(types[i], type))
             return i;