]> git.ipfire.org Git - thirdparty/libvirt.git/commit
network: fix crash when portgroup has no name
authorLaine Stump <laine@laine.org>
Wed, 28 Nov 2012 04:59:17 +0000 (23:59 -0500)
committerCole Robinson <crobinso@redhat.com>
Sun, 9 Dec 2012 21:53:40 +0000 (16:53 -0500)
commit2e7298d71868ebcde51d3b9943b57e579e4f694f
tree41651bf4f0b183e31c609cf86f85cf3f293aac51
parent3926d8571bf5cfe4ce0a9113a83d5029b4bb6091
network: fix crash when portgroup has no name

This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=879473

The name attribute is required for portgroup elements (yes, the RNG
specifies that), and there is code in libvirt that assumes it is
non-null.  Unfortunately, the portgroup parsing function wasn't
checking for lack of portgroup. One adverse result of this was that
attempts to update a network by adding a portgroup with no name would
cause libvirtd to segfault. For example:

   virsh net-update default add portgroup "<portgroup default='yes'/>"

This patch causes virNetworkPortGroupParseXML to fail if no name is
specified, thus avoiding any later problems.
(cherry picked from commit 012d69dff1e031f8079a9952e886a31795e589b2)
src/conf/network_conf.c