summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authoronoe <onoe@NetBSD.org>2000-07-06 08:20:51 +0000
committeronoe <onoe@NetBSD.org>2000-07-06 08:20:51 +0000
commit27f79f736968059e442ee633f0482ff8ca5cffb6 (patch)
treedd047c0bb6d48aa44796f3a9e23907e55ddd24c9 /sbin
parentf7448250911a38e1e7dd0ec973fa1ad393fe77b0 (diff)
cast u_char for ctype (nwid stuff) to fix possible overrun problems.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/ifconfig.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index bf9de410740..69946a0c401 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ifconfig.c,v 1.83 2000/07/06 00:50:49 onoe Exp $ */
+/* $NetBSD: ifconfig.c,v 1.84 2000/07/06 08:20:51 onoe Exp $ */
/*-
* Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
#if 0
static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
#else
-__RCSID("$NetBSD: ifconfig.c,v 1.83 2000/07/06 00:50:49 onoe Exp $");
+__RCSID("$NetBSD: ifconfig.c,v 1.84 2000/07/06 08:20:51 onoe Exp $");
#endif
#endif /* not lint */
@@ -1101,9 +1101,10 @@ setifnwid(val, d)
if (val[0] == '0' && (val[1] == 'x' || val[1] == 'X')) {
val += 2;
p = nwid.i_nwid;
- while (isxdigit(val[0]) && isxdigit(val[1])) {
+ while (isxdigit((u_char)val[0]) && isxdigit((u_char)val[1])) {
#define tohex(x) (isdigit(x) ? (x) - '0' : tolower(x) - 'a' + 10)
- *p++ = (tohex(val[0]) << 4) | tohex(val[1]);
+ *p++ = (tohex((u_char)val[0]) << 4) |
+ tohex((u_char)val[1]);
#undef tohex
val += 2;
}