diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-03-29 18:57:47 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-03-29 18:57:47 +0000 |
commit | 76c631cf6595321a876682958bd2559e4dcab871 (patch) | |
tree | ac4c0ade14e40b0072d2a89ead145896f109f874 /sys | |
parent | 49c09b84d97ca9f5e5293370667f0ced9c1b60b0 (diff) |
i_nwid is not a NUL-terminated string, it is length bounded.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/if_wi_hostap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/ic/if_wi_hostap.c b/sys/dev/ic/if_wi_hostap.c index a2436d1406b..bc8ffa2a8ce 100644 --- a/sys/dev/ic/if_wi_hostap.c +++ b/sys/dev/ic/if_wi_hostap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi_hostap.c,v 1.3 2002/03/28 22:22:33 mickey Exp $ */ +/* $OpenBSD: if_wi_hostap.c,v 1.4 2002/03/29 18:57:46 millert Exp $ */ /* * Copyright (c) 2002 @@ -619,10 +619,9 @@ wihap_assoc_req(struct wi_softc *sc, struct wi_frame *rxfrm, capinfo = take_hword(&pkt, &len); lstintvl = take_hword(&pkt, &len); if ((ssid_len=take_tlv(&pkt, &len, IEEE80211_ELEMID_SSID, - ssid.i_nwid, sizeof(ssid)-1))<0) + ssid.i_nwid, sizeof(ssid)))<0) return; ssid.i_len = ssid_len; - ssid.i_nwid[ssid_len] = '\0'; if ((rates_len=take_tlv(&pkt, &len, IEEE80211_ELEMID_RATES, rates, sizeof(rates)))<0) return; @@ -642,8 +641,9 @@ wihap_assoc_req(struct wi_softc *sc, struct wi_frame *rxfrm, memcmp(sc->wi_net_name.i_nwid, ssid.i_nwid, ssid.i_len)) { if (sc->arpcom.ac_if.if_flags & IFF_DEBUG) - printf("wihap_assoc_req: bad ssid: '%s' != '%s'\n", - ssid.i_nwid, sc->wi_net_name.i_nwid); + printf("wihap_assoc_req: bad ssid: '%.*s' != '%.*s'\n", + ssid.i_len, ssid.i_nwid, sc->wi_net_name.i_len, + sc->wi_net_name.i_nwid); return; } |