mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-05 08:41:39 +00:00
parse ovf: untaint path when calling file_size_info
Prepare for calling parse_ovf via API, where the -T switch is used. Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
6e55f5799e
commit
84c253e947
@ -221,10 +221,11 @@ ovf:Item[rasd:InstanceID='%s']/rasd:ResourceType", $controller_id);
|
|||||||
die "error parsing $filepath, file seems not to exist at $backing_file_path\n";
|
die "error parsing $filepath, file seems not to exist at $backing_file_path\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
my $virtual_size;
|
($backing_file_path) = $backing_file_path =~ m|^(/.*)|; # untaint
|
||||||
if ( !($virtual_size = PVE::Storage::file_size_info($backing_file_path)) ) {
|
|
||||||
die "error parsing $backing_file_path, size seems to be $virtual_size\n";
|
my $virtual_size = PVE::Storage::file_size_info($backing_file_path);
|
||||||
}
|
die "error parsing $backing_file_path, cannot determine file size\n"
|
||||||
|
if !$virtual_size;
|
||||||
|
|
||||||
$pve_disk = {
|
$pve_disk = {
|
||||||
disk_address => $pve_disk_address,
|
disk_address => $pve_disk_address,
|
||||||
|
Loading…
Reference in New Issue
Block a user