]> git.proxmox.com Git - pve-storage.git/commitdiff
nexenta: nexenta_get_zvol_size : parse result to avoid tainted value
authorAlexandre Derumier <aderumier@odiso.com>
Mon, 27 May 2013 09:41:37 +0000 (11:41 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 28 May 2013 10:39:09 +0000 (12:39 +0200)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/Storage/NexentaPlugin.pm

index 857df542298286136eea028fabd94fc7fef1c1d3..93cd0cffc50298812fdd79796b5f1697dbb7f438 100644 (file)
@@ -42,7 +42,10 @@ sub nexenta_request {
 sub nexenta_get_zvol_size {
     my ($scfg, $zvol) = @_;
 
-    return nexenta_request($scfg, 'get_child_prop', 'zvol', $zvol, 'size_bytes');
+    my $ret = nexenta_request($scfg, 'get_child_prop', 'zvol', $zvol, 'size_bytes');
+    $ret =~ m/^(\d+)$/ or die "size is not valid";
+    my $size = $1;
+    return $size;
 }
 
 sub nexenta_get_zvol_props {