]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: Don't deref NULL actual network in virDomainNetGetActualHostdev()
authorPeter Krempa <pkrempa@redhat.com>
Wed, 4 Sep 2013 15:32:12 +0000 (17:32 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 5 Sep 2013 07:41:44 +0000 (09:41 +0200)
commita3d24862df9d717b95fae3951019fa150a9d4e09
treef6e8b67d36fd380b7b5d7ffa84e93a77b4610b7a
parentb78e8cb2ec14ef243fbd578835b200f6d9ad31dc
conf: Don't deref NULL actual network in virDomainNetGetActualHostdev()

In commit 991270db99690 I've used virDomainNetGetActualHostdev() to get
the actual hostdev from a network when removing the network from the
list to avoid leaving the hostdev in the list. I didn't notice that this
function doesn't check if the actual network is allocated and
dereferences it. This crashes the daemon when cleaning up a domain
object in early startup phases when the actual network definition isn't
allocated. When the actual definition isn't present, the hostdev that
might correspond to it won't be present anyways so it's safe to return
NULL.

Thanks to Cole Robinson for noticing this problem.
src/conf/domain_conf.c