mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
dmsetup: check also for ouf of range value
Check errno result from strtoull().
This commit is contained in:
parent
a3eb6ba425
commit
718e38d5fa
@ -5106,8 +5106,9 @@ static int _size_from_string(char *argptr, uint64_t *size, const char *name)
|
||||
if (!argptr)
|
||||
return_0;
|
||||
|
||||
errno = 0;
|
||||
*size = strtoull(argptr, &endptr, 10);
|
||||
if (endptr == argptr) {
|
||||
if (errno || endptr == argptr) {
|
||||
*size = 0;
|
||||
log_error("Invalid %s argument: \"%s\"",
|
||||
name, (*argptr) ? argptr : "");
|
||||
|
Loading…
Reference in New Issue
Block a user