diff options
author | Ondrej Kozina <okozina@redhat.com> | 2015-05-26 15:55:16 +0200 |
---|---|---|
committer | Ondrej Kozina <okozina@redhat.com> | 2015-05-26 16:27:03 +0200 |
commit | c069aff21b1450923b59e98ab709a5e667cdcda9 (patch) | |
tree | e26d36409027c6041e19bb9218e9c5f175561c66 | |
parent | a72a80589689961285ec6aacff99087ddd8c378d (diff) | |
download | lvm2-c069aff21b1450923b59e98ab709a5e667cdcda9.tar.gz |
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.
-rw-r--r-- | daemons/lvmpolld/lvmpolld-core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/daemons/lvmpolld/lvmpolld-core.c b/daemons/lvmpolld/lvmpolld-core.c index 1a33625a1..c1d583e71 100644 --- a/daemons/lvmpolld/lvmpolld-core.c +++ b/daemons/lvmpolld/lvmpolld-core.c @@ -749,6 +749,7 @@ static int process_timeout_arg(const char *str, unsigned *max_timeouts) char *endptr; unsigned long l; + errno = 0; l = strtoul(str, &endptr, 10); if (errno || *endptr || l >= UINT_MAX) return 0; |