From: Pavel Hrdina Date: Mon, 1 Dec 2014 16:23:00 +0000 (+0100) Subject: nwfilter: fix crash when adding non-existing nwfilter X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d98ad8dd0c5a1d9f6a804e23f0568c784469c3fd;p=libvirt.git nwfilter: fix crash when adding non-existing nwfilter 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 --- diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c index 074d7456df..317792eb50 100644 --- a/src/conf/nwfilter_conf.c +++ b/src/conf/nwfilter_conf.c @@ -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]); }