From b9474c9682f16179360e9e7c00644a871cfe3ae5 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 27 Jul 2018 14:55:17 +0200 Subject: [PATCH] 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 --- src/PVE/CLIFormatter.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PVE/CLIFormatter.pm b/src/PVE/CLIFormatter.pm index f6ad459..119bc06 100644 --- a/src/PVE/CLIFormatter.pm +++ b/src/PVE/CLIFormatter.pm @@ -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, -- 2.39.2