From: Fabian Grünbichler Date: Wed, 20 Apr 2016 07:54:39 +0000 (+0200) Subject: fix #945: add uninitialized check in lxc ipset compilation X-Git-Url: https://git.proxmox.com/?p=pve-firewall.git;a=commitdiff_plain;h=37ef1ce1bc8b880f9fe2f9b2c43fb314d4fdba63 fix #945: add uninitialized check in lxc ipset compilation --- diff --git a/src/PVE/Firewall.pm b/src/PVE/Firewall.pm index 7d021ed..4c1586a 100644 --- a/src/PVE/Firewall.pm +++ b/src/PVE/Firewall.pm @@ -3523,10 +3523,10 @@ sub compile_ipsets { { cidr => $linklocal }, { cidr => 'fe80::/10', nomatch => 1 } ]; - if ($net->{ip} =~ m!^($IPV4RE)(?:/\d+)?$!) { + if (defined($net->{ip}) && $net->{ip} =~ m!^($IPV4RE)(?:/\d+)?$!) { push @$set, { cidr => $1 }; } - if ($net->{ip6} =~ m!^($IPV6RE)(?:/\d+)?$!) { + if (defined($net->{ip6}) && $net->{ip6} =~ m!^($IPV6RE)(?:/\d+)?$!) { push @$set, { cidr => $1 }; } }