fixup error messages when getting file size info
The assignment happens before the 'die', so the error message would always contain 'undef'. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
22cb4b0b78
commit
98a5bc5c9b
@ -974,13 +974,16 @@ sub file_size_info {
|
||||
|
||||
my ($size, $format, $used, $parent) = $info->@{qw(virtual-size format actual-size backing-filename)};
|
||||
|
||||
($size) = ($size =~ /^(\d+)$/) or die "size '$size' not an integer\n"; # untaint
|
||||
($size) = ($size =~ /^(\d+)$/); # untaint
|
||||
die "size '$size' not an integer\n" if !defined($size);
|
||||
# coerce back from string
|
||||
$size = int($size);
|
||||
($used) = ($used =~ /^(\d+)$/) or die "used '$used' not an integer\n"; # untaint
|
||||
($used) = ($used =~ /^(\d+)$/); # untaint
|
||||
die "used '$used' not an integer\n" if !defined($used);
|
||||
# coerce back from string
|
||||
$used = int($used);
|
||||
($format) = ($format =~ /^(\S+)$/) or die "format '$format' includes whitespace\n"; # untaint
|
||||
($format) = ($format =~ /^(\S+)$/); # untaint
|
||||
die "format '$format' includes whitespace\n" if !defined($format);
|
||||
if (defined($parent)) {
|
||||
($parent) = ($parent =~ /^(\S+)$/); # untaint
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user