|
|
9119d9 |
From 08c80f998f5d9135aa5affc36ba7848a2bfa447e Mon Sep 17 00:00:00 2001
|
|
|
9119d9 |
Message-Id: <08c80f998f5d9135aa5affc36ba7848a2bfa447e@dist-git>
|
|
|
9119d9 |
From: Pavel Hrdina <phrdina@redhat.com>
|
|
|
9119d9 |
Date: Tue, 2 Dec 2014 11:16:20 +0100
|
|
|
9119d9 |
Subject: [PATCH] nwfilter: fix crash when adding non-existing nwfilter
|
|
|
9119d9 |
|
|
|
9119d9 |
Adding non-existing nwfilter to a network interface device without any
|
|
|
9119d9 |
nwfilter specified will crash libvirt daemon with segfault. The reason is
|
|
|
9119d9 |
that the nwfilter is not found an libvirt will try to restore old
|
|
|
9119d9 |
nwfilter configuration but there is no nwfilter specified.
|
|
|
9119d9 |
|
|
|
9119d9 |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
9119d9 |
(cherry picked from commit d98ad8dd0c5a1d9f6a804e23f0568c784469c3fd)
|
|
|
9119d9 |
|
|
|
9119d9 |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1169409
|
|
|
9119d9 |
|
|
|
9119d9 |
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
|
|
9119d9 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
9119d9 |
---
|
|
|
9119d9 |
src/conf/nwfilter_conf.c | 2 +-
|
|
|
9119d9 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
9119d9 |
|
|
|
9119d9 |
diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c
|
|
|
9119d9 |
index 52f24e4..24e0b68 100644
|
|
|
9119d9 |
--- a/src/conf/nwfilter_conf.c
|
|
|
9119d9 |
+++ b/src/conf/nwfilter_conf.c
|
|
|
9119d9 |
@@ -2770,7 +2770,7 @@ virNWFilterObjFindByName(virNWFilterObjListPtr nwfilters, const char *name)
|
|
|
9119d9 |
|
|
|
9119d9 |
for (i = 0; i < nwfilters->count; i++) {
|
|
|
9119d9 |
virNWFilterObjLock(nwfilters->objs[i]);
|
|
|
9119d9 |
- if (STREQ(nwfilters->objs[i]->def->name, name))
|
|
|
9119d9 |
+ if (STREQ_NULLABLE(nwfilters->objs[i]->def->name, name))
|
|
|
9119d9 |
return nwfilters->objs[i];
|
|
|
9119d9 |
virNWFilterObjUnlock(nwfilters->objs[i]);
|
|
|
9119d9 |
}
|
|
|
9119d9 |
--
|
|
|
9119d9 |
2.2.0
|
|
|
9119d9 |
|