diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2022-08-18 13:56:03 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2022-08-19 14:56:57 +0200 |
commit | 718e38d5faf3a3ca23690d2f4203df1df65eba77 (patch) | |
tree | 65ed8a2f6f309a388e70ff2b2ced82b1a0c95128 | |
parent | a3eb6ba425773224076c41aabc3c490a6a016ee6 (diff) | |
download | lvm2-718e38d5faf3a3ca23690d2f4203df1df65eba77.tar.gz |
dmsetup: check also for ouf of range value
Check errno result from strtoull().
-rw-r--r-- | libdm/dm-tools/dmsetup.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libdm/dm-tools/dmsetup.c b/libdm/dm-tools/dmsetup.c index 8502d9adc..42eeead68 100644 --- a/libdm/dm-tools/dmsetup.c +++ b/libdm/dm-tools/dmsetup.c @@ -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 : ""); |