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:
parent
c069aff21b
commit
8af5f54824
@ -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) ||
|
||||
|
Loading…
Reference in New Issue
Block a user