From: Marc Hartmayer Date: Thu, 9 Feb 2017 14:13:36 +0000 (+0100) Subject: conf: Fix libvirtd free() segfault if virDomainChrSourceDefNew(...) fails X-Git-Tag: CVE-2017-2635~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28dd54a5b971764c9a3a89b66acde053efaec2f7;p=thirdparty%2Flibvirt.git conf: Fix libvirtd free() segfault if virDomainChrSourceDefNew(...) fails If virDomainChrSourceDefNew(xmlopt) fails, it will lead to free()ing the uninitialized pointer bus. The fix for this is to initialize bus with NULL. Signed-off-by: Marc Hartmayer Reviewed-by: Boris Fiuczynski Reviewed-by: Bjoern Walk --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ba55791a04..1bc72a4e90 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13317,7 +13317,7 @@ virDomainRedirdevDefParseXML(virDomainXMLOptionPtr xmlopt, { xmlNodePtr cur; virDomainRedirdevDefPtr def; - char *bus, *type = NULL; + char *bus = NULL, *type = NULL; int remaining; if (VIR_ALLOC(def) < 0)