summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/ethers.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/net/ethers.c')
-rw-r--r--lib/libc/net/ethers.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/net/ethers.c b/lib/libc/net/ethers.c
index 9df876b6f49..94ae5c996ad 100644
--- a/lib/libc/net/ethers.c
+++ b/lib/libc/net/ethers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ethers.c,v 1.9 1998/06/21 22:13:44 millert Exp $ */
+/* $OpenBSD: ethers.c,v 1.10 1998/11/18 23:28:54 deraadt Exp $ */
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -34,7 +34,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: ethers.c,v 1.9 1998/06/21 22:13:44 millert Exp $";
+static char rcsid[] = "$OpenBSD: ethers.c,v 1.10 1998/11/18 23:28:54 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -92,7 +92,7 @@ _ether_aton(s, e)
/* expect 6 hex octets separated by ':' or space/NUL if last octet */
for (i = 0; i < 6; i++) {
l = strtol(s, &pp, 16);
- if (pp == s || l > 0xFF)
+ if (pp == s || l > 0xFF || l < 0)
return (NULL);
if (!(*pp == ':' || (i == 5 && (isspace(*pp) || *pp == '\0'))))
return (NULL);