summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sbin/ifconfig/ifieee80211.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c
index 5cef7ab..ffd01f6 100644
--- a/sbin/ifconfig/ifieee80211.c
+++ b/sbin/ifconfig/ifieee80211.c
@@ -1913,9 +1913,10 @@ get_string(const char *val, const char *sep, u_int8_t *buf, int *lenp)
}
len = p - buf;
/* The string "-" is treated as the empty string. */
- if (!hexstr && len == 1 && buf[0] == '-')
+ if (!hexstr && len == 1 && buf[0] == '-') {
len = 0;
- if (len < *lenp)
+ memset(buf, 0, *lenp);
+ } else if (len < *lenp)
memset(p, 0, *lenp - len);
*lenp = len;
return val;
OpenPOWER on IntegriCloud