master - dmsetup: zero errno in before strtoul call
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8af5f54824f889c438104625dbe159f6e8dedbc4 Commit: 8af5f54824f889c438104625dbe159f6e8dedbc4 Parent: c069aff21b1450923b59e98ab709a5e667cdcda9 Author: Ondrej Kozina <[email protected]> AuthorDate: Tue May 26 16:01:40 2015 +0200 Committer: Ondrej Kozina <[email protected]> CommitterDate: Tue May 26 16:27:10 2015 +0200
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.
--- tools/dmsetup.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
tools/dmsetup.c +1 -0
@@ -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) ||