[libvirt] [PATCH] nwfilter: fix crash when adding non-existing nwfilter

Eric Blake eblake at redhat.com
Mon Dec 1 21:33:19 UTC 2014


On 12/01/2014 09:23 AM, Pavel Hrdina wrote:
> 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 at redhat.com>
> ---
>  src/conf/nwfilter_conf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

ACK

> 
> diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c
> index 074d745..317792e 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]);
>      }
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 539 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141201/4f36d373/attachment-0001.sig>


More information about the libvir-list mailing list