[pve-devel] [PATCH cluster] add check for int overflow on vmids

Dietmar Maurer dietmar at proxmox.com
Thu Feb 18 19:12:48 CET 2016


That error check is wrong (see man strtoul)

I uploaded a fix here:

https://git.proxmox.com/?p=pve-cluster.git;a=commitdiff;h=8f8fbe90036f7cb52d2786def6ec4a3dde80f620

> diff --git a/data/src/memdb.c b/data/src/memdb.c
> index af20e05..57c2804 100644
> --- a/data/src/memdb.c
> +++ b/data/src/memdb.c
> @@ -213,7 +213,7 @@ name_is_vm_config(
>  	guint32 vmid =  strtoul(name, &end, 10);
>  
>  	if (!end || end[0] != '.' || end[1] != 'c'|| end[2] != 'o' || end[3] != 'n'
> ||
> -	    end[4] != 'f' || end[5] != 0)
> +	    end[4] != 'f' || end[5] != 0 || errno == ERANGE)
>  		return FALSE;
>  
>  	if (vmid_ret)
> -- 
> 2.1.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