mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-15 13:40:00 +00:00
render_bytes: check format, untaint before calling sprintf
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
parent
c701c5659e
commit
a91ee28fe5
@ -69,6 +69,9 @@ PVE::JSONSchema::register_renderer(
|
|||||||
sub render_bytes {
|
sub render_bytes {
|
||||||
my ($value) = @_;
|
my ($value) = @_;
|
||||||
|
|
||||||
|
return $value if $value !~ m/^(\d+)$/;
|
||||||
|
$value = int($1); # untaint for sprintf
|
||||||
|
|
||||||
my @units = qw(B KiB MiB GiB TiB PiB);
|
my @units = qw(B KiB MiB GiB TiB PiB);
|
||||||
|
|
||||||
my $max_unit = 0;
|
my $max_unit = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user