]> xenbits.xensource.com Git - libvirt.git/commitdiff
nwfilter: fix crash when adding non-existing nwfilter
authorPavel Hrdina <phrdina@redhat.com>
Mon, 1 Dec 2014 16:23:00 +0000 (17:23 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Tue, 2 Dec 2014 10:12:05 +0000 (11:12 +0100)
Adding non-existing nwfilter to a network interface device without any
nwfilter specified will crash libvirt daemon with segfault. The reason is
that the nwfilter is not found an libvirt will try to restore old
nwfilter configuration but there is no nwfilter specified.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
src/conf/nwfilter_conf.c

index 074d7456df572318558e260ab6f83ab559615d8f..317792eb50a32c5507c25b49231107613e6ccc0d 100644 (file)
@@ -2778,7 +2778,7 @@ virNWFilterObjFindByName(virNWFilterObjListPtr nwfilters, const char *name)
 
     for (i = 0; i < nwfilters->count; i++) {
         virNWFilterObjLock(nwfilters->objs[i]);
-        if (STREQ(nwfilters->objs[i]->def->name, name))
+        if (STREQ_NULLABLE(nwfilters->objs[i]->def->name, name))
             return nwfilters->objs[i];
         virNWFilterObjUnlock(nwfilters->objs[i]);
     }