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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Stef Walter <stef@xxxxxxxxxxxxx>

https://bugzilla.redhat.com/show_bug.cgi?id=1202104
---
 misc-utils/logger.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index ab734dd..9613b95 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -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;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux