1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

dmsetup: zero errno in before strtoul call

Testing errno value without explicitly setting to
zero in before the strtoul call may lead to
unexpected failures.
This commit is contained in:
Ondrej Kozina 2015-05-26 16:01:40 +02:00
parent c069aff21b
commit 8af5f54824

View File

@ -914,6 +914,7 @@ static uint32_t _get_cookie_value(const char *str_value)
unsigned long int value;
char *p;
errno = 0;
if (!(value = strtoul(str_value, &p, 0)) ||
*p ||
(value == ULONG_MAX && errno == ERANGE) ||