From: Thomas Lamprecht Date: Mon, 9 Mar 2020 10:28:21 +0000 (+0100) Subject: inotify: read interfaces: avoid uninitialized value access X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=d2513a84dffd50e7b9cdf3a9780b75af94f43cc8 inotify: read interfaces: avoid uninitialized value access check if 'ovs_type' is defined first Signed-off-by: Thomas Lamprecht --- diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm index d0d9ba6..391b9d2 100644 --- a/src/PVE/INotify.pm +++ b/src/PVE/INotify.pm @@ -1097,10 +1097,12 @@ sub __read_etc_network_interfaces { } else { if ($d->{'vxlan-id'}) { $d->{type} = 'vxlan'; - } elsif ($d->{ovs_type} eq 'OVSIntPort') { - $d->{type} = $d->{ovs_type}; - my $tag = &$extract_ovs_option($d, 'tag'); - $d->{ovs_tag} = $tag if defined($tag); + } elsif (defined($d->{ovs_type})) { + if ($d->{ovs_type} eq 'OVSIntPort') { + $d->{type} = $d->{ovs_type}; + my $tag = &$extract_ovs_option($d, 'tag'); + $d->{ovs_tag} = $tag if defined($tag); + } } }