From: Michal Privoznik Date: Mon, 10 Feb 2014 18:26:16 +0000 (+0100) Subject: virNetworkLoadState: Disallow mangled 'floor' element X-Git-Tag: v1.2.2-rc1~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28900766d570ca09015ed2b2d74a85a3f4ebf0b8;p=thirdparty%2Flibvirt.git virNetworkLoadState: Disallow mangled 'floor' element In the network status XML we may have the element with the 'sum' attribute. The attribute represents sum of all 'floor'-s of computed over each interface connected to the network (this is needed to guarantee certain bandwidth for certain domain). The sum is therefore a number. However, if the number was mangled (e.g. by an user's interference to network status file), we've just ignored it without refusing to parse such file. This was all due to 'goto error' missing. Signed-off-by: Michal Privoznik --- diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index e59938cb56..dd3fa193ac 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -2959,6 +2959,7 @@ virNetworkLoadState(virNetworkObjListPtr nets, _("Malformed 'floor_sum' attribute: %s"), floor_sum); VIR_FREE(floor_sum); + goto error; } VIR_FREE(floor_sum); }