From: Osier Yang Date: Wed, 16 Mar 2011 08:28:07 +0000 (+0800) Subject: storage: Fix a problem which will cause libvirtd crashed X-Git-Tag: CVE-2011-1486~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98a4e5a301eb96b4d6c80b859e9986491e1eae06;p=thirdparty%2Flibvirt.git storage: Fix a problem which will cause libvirtd crashed If pool xml has no definition for "port", then "Segmentation fault" happens when jumping to "cleanup:" to do "VIR_FREE(port)", as "port" was not initialized in this situation. * src/conf/storage_conf.c --- diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 6e3fe0e197..13a36229fe 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -396,7 +396,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, char *authType = NULL; int nsource, i; virStoragePoolOptionsPtr options; - char *port; + char *port = NULL; relnode = ctxt->node; ctxt->node = node;