5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-01-06 21:17:37 +03:00

REST Handler: check for value defindness when untainting

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-01-08 10:32:12 +01:00
parent f27d5e6b7a
commit 12349ad05f

View File

@ -438,7 +438,11 @@ sub handle {
# untaint data (already validated)
my $extra = delete $param->{'extra-args'};
while (my ($key, $val) = each %$param) {
($param->{$key}) = $val =~ /^(.*)$/s;
if (defined($val)) {
($param->{$key}) = $val =~ /^(.*)$/s;
} else {
$param->{$key} = undef;
}
}
$param->{'extra-args'} = [map { /^(.*)$/ } @$extra] if $extra;
}