mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
lvmpolld: 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
a72a805896
commit
c069aff21b
@ -749,6 +749,7 @@ static int process_timeout_arg(const char *str, unsigned *max_timeouts)
|
|||||||
char *endptr;
|
char *endptr;
|
||||||
unsigned long l;
|
unsigned long l;
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
l = strtoul(str, &endptr, 10);
|
l = strtoul(str, &endptr, 10);
|
||||||
if (errno || *endptr || l >= UINT_MAX)
|
if (errno || *endptr || l >= UINT_MAX)
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user