]> git.proxmox.com Git - pve-firewall.git/commitdiff
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 7d021ed1980937b0c268bd81ac9b265b693fc692..4c1586afec58bb8f91639af7a942b93914c31e06 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 };
                }
            }