1
0
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:
Zdenek Kabelac 2022-08-18 13:56:03 +02:00
parent a3eb6ba425
commit 718e38d5fa

View File

@ -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 : "");