]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
logger: Fix use of errno after strtol() without zeroing first
authorStef Walter <stef@thewalter.net>
Sun, 15 Mar 2015 13:23:32 +0000 (14:23 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 16 Mar 2015 10:25:37 +0000 (11:25 +0100)
References: https://bugzilla.redhat.com/show_bug.cgi?id=1202104
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/logger.c

index ab734ddd6bf50476ab05a262a8191e4e0db57f90..9613b951e854c9d54f53cc4d91030bfbbbe8b4e3 100644 (file)
@@ -127,6 +127,7 @@ static int decode(const char *name, CODE *codetab)
                int num;
                char *end = NULL;
 
+               errno = 0;
                num = strtol(name, &end, 10);
                if (errno || name == end || (end && *end))
                        return -1;