Skip to contentSkip to conversation

logger: Fix use of errno after strtol() without zeroing first

PATCH Applied Stef Walter 2 participants 2 messages Mar 15, 2015 – Mar 16, 2015 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 logger: Fix use of errno after strtol() without zeroing first

From: Stef Walter <[email protected]>

https://bugzilla.redhat.com/show_bug.cgi?id=1202104

---
 misc-utils/logger.c | 1 +
 1 file changed, 1 insertion(+)
misc-utils/logger.c +1 -0
index ab734dd..9613b95 100644
@@ -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;
Signature · 1 line
2.1.0
maintainer Applied
#1 lore raw
Quoted 2 lines · Stef Walter
 misc-utils/logger.c | 1 +
 1 file changed, 1 insertion(+)

Applied, thanks.

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com