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

Dietmar Maurer dietmar at proxmox.com
Tue May 28 12:40:16 CEST 2013


applied, thanks!

> -----Original Message-----
> From: pve-devel-bounces at pve.proxmox.com [mailto:pve-devel-
> bounces at pve.proxmox.com] On Behalf Of Alexandre Derumier
> Sent: Montag, 27. Mai 2013 11:42
> To: pve-devel at pve.proxmox.com
> Subject: [pve-devel] [PATCH] nexenta: nexenta_get_zvol_size : parse result
> to avoid tainted value
> 
> 
> 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..93cd0cf 100644
> --- a/PVE/Storage/NexentaPlugin.pm
> +++ b/PVE/Storage/NexentaPlugin.pm
> @@ -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 {
> --
> 1.7.10.4
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel





More information about the pve-devel mailing list