[libvirt-glib 2/5] gobject: Error out on NULL name in gvir_storage_pool_get_volume

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

 



Without this change, gvir_storage_pool_get_volume segfaults when
trying to do the hash table lookup with a NULL 'name' key.
---
 libvirt-gobject/libvirt-gobject-storage-pool.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libvirt-gobject/libvirt-gobject-storage-pool.c b/libvirt-gobject/libvirt-gobject-storage-pool.c
index dc34c2e..a380079 100644
--- a/libvirt-gobject/libvirt-gobject-storage-pool.c
+++ b/libvirt-gobject/libvirt-gobject-storage-pool.c
@@ -538,6 +538,7 @@ GVirStorageVol *gvir_storage_pool_get_volume(GVirStoragePool *pool,
     GVirStorageVol *volume;
 
     g_return_val_if_fail(GVIR_IS_STORAGE_POOL(pool), NULL);
+    g_return_val_if_fail(name != NULL, NULL);
 
     priv = pool->priv;
     g_mutex_lock(priv->lock);
-- 
1.8.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]