[pve-devel] [PATCH] nexenta: volume_size_info: parse result to avoid tainted value

Alexandre Derumier aderumier at odiso.com
Mon May 27 10:15:02 CEST 2013


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Storage/NexentaPlugin.pm |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/PVE/Storage/NexentaPlugin.pm b/PVE/Storage/NexentaPlugin.pm
index 857df54..d87f3ca 100644
--- a/PVE/Storage/NexentaPlugin.pm
+++ b/PVE/Storage/NexentaPlugin.pm
@@ -436,7 +436,10 @@ sub volume_size_info {
 
     my ($vtype, $name, $vmid) = $class->parse_volname($volname);
 
-    return nexenta_get_zvol_size($scfg, "$scfg->{pool}/$name"),
+    my $ret = nexenta_get_zvol_size($scfg, "$scfg->{pool}/$name");
+    $ret =~ m/^(\d+)$/ or die "size is not valid";
+    my $size = $1;
+    return $size;
 }
 
 sub volume_resize {
-- 
1.7.10.4




More information about the pve-devel mailing list