fix #945: add uninitialized check in lxc ipset compilation
authorFabian Gr├╝nbichler <f.gruenbichler@proxmox.com>
Wed, 20 Apr 2016 07:54:39 +0000 (09:54 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 21 Apr 2016 07:58:08 +0000 (09:58 +0200)
src/PVE/Firewall.pm

index 7d021ed..4c1586a 100644 (file)
@@ -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 };
                }
            }