lvm commandline: fix a possible number overflow Use strtoull instead of strtol so that argument size is not cut to 31 bytes on machines with 32-bit long. Signed-off-by: Mikulas Patocka --- tools/lvmcmdline.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) Index: lvm2-copy/tools/lvmcmdline.c =================================================================== --- lvm2-copy.orig/tools/lvmcmdline.c 2013-07-16 19:08:27.000000000 +0200 +++ lvm2-copy/tools/lvmcmdline.c 2013-07-16 19:09:56.000000000 +0200 @@ -241,7 +241,7 @@ int metadatatype_arg(struct cmd_context static int _get_int_arg(struct arg_values *av, char **ptr) { char *val; - long v; + unsigned long long v; av->percent = PERCENT_NONE; @@ -262,9 +262,10 @@ static int _get_int_arg(struct arg_value if (!isdigit(*val)) return 0; - v = strtol(val, ptr, 10); + errno = 0; + v = strtoull(val, ptr, 10); - if (*ptr == val) + if (*ptr == val || errno) return 0; av->i_value = (int32_t) v;