From 37ef1ce1bc8b880f9fe2f9b2c43fb314d4fdba63 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 20 Apr 2016 09:54:39 +0200 Subject: [PATCH] fix #945: add uninitialized check in lxc ipset compilation --- src/PVE/Firewall.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 }; } } -- 2.39.2