summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sbin/ifconfig/ifieee80211.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c
index 6f83de0..1e83e80 100644
--- a/sbin/ifconfig/ifieee80211.c
+++ b/sbin/ifconfig/ifieee80211.c
@@ -546,17 +546,20 @@ get_string(const char *val, const char *sep, u_int8_t *buf, int *lenp)
break;
}
if (hexstr) {
- if (!isxdigit((u_char)val[0]) ||
- !isxdigit((u_char)val[1])) {
+ if (!isxdigit((u_char)val[0])) {
warnx("bad hexadecimal digits");
return NULL;
}
+ if (!isxdigit((u_char)val[1])) {
+ warnx("odd count hexadecimal digits");
+ return NULL;
+ }
}
- if (p > buf + len) {
+ if (p >= buf + len) {
if (hexstr)
warnx("hexadecimal digits too long");
else
- warnx("strings too long");
+ warnx("string too long");
return NULL;
}
if (hexstr) {
OpenPOWER on IntegriCloud