[pve-devel] applied: [PATCH firewall] fix use of uninitialized value

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Aug 27 09:12:26 CEST 2019


On 26.08.19 14:55, Mira Limbeck wrote:
> $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 at proxmox.com>
> ---
>  src/PVE/API2/Firewall/Aliases.pm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/PVE/API2/Firewall/Aliases.pm b/src/PVE/API2/Firewall/Aliases.pm
> index 6f421fb..b81dc9d 100644
> --- a/src/PVE/API2/Firewall/Aliases.pm
> +++ b/src/PVE/API2/Firewall/Aliases.pm
> @@ -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" }) 
> 

applied to master and stable-5, thanks!




More information about the pve-devel mailing list