]> git.proxmox.com Git - pve-firewall.git/commitdiff
fix use of uninitialized value stable-5
authorMira Limbeck <m.limbeck@proxmox.com>
Mon, 26 Aug 2019 12:55:25 +0000 (14:55 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 27 Aug 2019 07:12:55 +0000 (09:12 +0200)
$param->{rename} was not checked for definedness even though it is
optional. This lead to a 'use of uninitialized value' when just updating
the cidr.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
(cherry picked from commit 13d39f198ad142a013077f4b3cc436257f7a1a11)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/API2/Firewall/Aliases.pm

index 6f421fbe271ff8c75e09fe5533f95b71bd94f0c3..b81dc9d06405417bb55640cb986d34091136287b 100644 (file)
@@ -230,7 +230,8 @@ sub register_update_alias {
 
            $aliases->{$name} = $data;
 
-           my $rename = lc($param->{rename});
+           my $rename = $param->{rename};
+           $rename = lc($rename) if $rename;
 
            if ($rename && ($name ne $rename)) {
                raise_param_exc({ name => "alias '$param->{rename}' already exists" })