print_text_table: untaint $width

The value of $width depends on possible untainted $data (for example
task logs read from external files).

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
Dietmar Maurer 2018-07-27 14:55:17 +02:00 committed by Thomas Lamprecht
parent 6c7fee81f2
commit b9474c9682

View File

@ -209,6 +209,8 @@ sub print_text_table {
$width = $len if $len > $width;
}
$width = ($width =~ m/^(\d+)$/) ? int($1) : 0; # untaint int
$rowdata->{$prop} = {
lines => $lines,
width => $width,