cleaned input for "zmcamtool.pl --export <control_or_preset_name>" to fix error when running in taint mode

This commit is contained in:
zlodag 2020-02-16 11:26:23 +13:00
parent 9c65a8b293
commit 2c51b1436c
1 changed files with 5 additions and 2 deletions

View File

@ -351,8 +351,11 @@ sub exportsql {
} }
} }
if ($ARGV[0]) { my $name = $ARGV[0];
$command .= qq( --where="Name = '$ARGV[0]'"); if ($name) {
$name =~ /([A-Za-z0-9 -]*)/; # Only allow alphanumeric, dash and space
$name = $1;
$command .= qq( --where="Name = '$name'");
} }
$command .= " zm Controls MonitorPresets"; $command .= " zm Controls MonitorPresets";