]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virNetworkLoadState: Disallow mangled 'floor' element
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 10 Feb 2014 18:26:16 +0000 (19:26 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 10 Feb 2014 18:26:16 +0000 (19:26 +0100)
In the network status XML we may have the <floor/> 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 <mprivozn@redhat.com>
src/conf/network_conf.c

index e59938cb561e0336e5f69320fcf9683f107911bb..dd3fa193acce2df5b0a232a73f57b3278e2b1d6a 100644 (file)
@@ -2959,6 +2959,7 @@ virNetworkLoadState(virNetworkObjListPtr nets,
                            _("Malformed 'floor_sum' attribute: %s"),
                            floor_sum);
             VIR_FREE(floor_sum);
+            goto error;
         }
         VIR_FREE(floor_sum);
     }