mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
networkBandwidthUpdate: Don't blindly dereference pointers
It may happen that an interface don't have any bandwidth set and a new one is to be set. In that case, @ifaceBand will be NULL. This will cause troubles later in the code when deciding what to do. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
73ca6f98a3
commit
ef6b3b625d
@ -5048,8 +5048,8 @@ networkBandwidthUpdate(virDomainNetDefPtr iface,
|
||||
|
||||
/* Okay, there are three possible scenarios: */
|
||||
|
||||
if (ifaceBand->in && ifaceBand->in->floor &&
|
||||
newBandwidth->in && newBandwidth->in->floor) {
|
||||
if (ifaceBand && ifaceBand->in && ifaceBand->in->floor &&
|
||||
newBandwidth && newBandwidth->in && newBandwidth->in->floor) {
|
||||
/* Either we just need to update @floor .. */
|
||||
|
||||
if (virNetDevBandwidthUpdateRate(network->def->bridge,
|
||||
|
Loading…
x
Reference in New Issue
Block a user