On 01/07/2015 12:31 PM, Michal Privoznik wrote:
There's this function virNetDevBandwidthParse which parses the
bandwidth XML snippet. But it's not clever much. For the
following XML it allocates the virNetDevBandwidth structure even
though it's completely empty:
<bandwidth>
</bandwidth>
Later in the code there are some places where we check if
bandwidth was set or not. And since we obtained pointer from the
parsing function we think that it is when in fact it isn't.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/domain_conf.c | 10 ++++++----
src/conf/netdev_bandwidth_conf.c | 38 +++++++++++++++++++++++---------------
src/conf/netdev_bandwidth_conf.h | 7 ++++---
src/conf/network_conf.c | 7 +++----
tests/virnetdevbandwidthtest.c | 12 ++++++------
5 files changed, 42 insertions(+), 32 deletions(-)
ACK
John