diff options
author | sam <sam@FreeBSD.org> | 2009-01-28 18:39:23 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2009-01-28 18:39:23 +0000 |
commit | 2c8d272b5e9992084e093774367cd5f13287f9ee (patch) | |
tree | 9ad1659d444e21f7e8ca670e001d5dec47e8e8d8 /sys | |
parent | dce44e3d8e39301c140e60680785c7df919261e5 (diff) | |
download | FreeBSD-src-2c8d272b5e9992084e093774367cd5f13287f9ee.zip FreeBSD-src-2c8d272b5e9992084e093774367cd5f13287f9ee.tar.gz |
add an assert to verify the number of channels returned by ic_getradiocaps
correlates with the size of the channel array passed down
might want to promote this to be always present to catch for driver errors
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net80211/ieee80211_ioctl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 6450988..db36adb 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -715,6 +715,8 @@ ieee80211_ioctl_getdevcaps(struct ieee80211com *ic, dc->dc_htcaps = ic->ic_htcaps; ci = &dc->dc_chaninfo; ic->ic_getradiocaps(ic, maxchans, &ci->ic_nchans, ci->ic_chans); + KASSERT(ci->ic_nchans <= maxchans, + ("nchans %d maxchans %d", ci->ic_nchans, maxchans)); ieee80211_sort_channels(ci->ic_chans, ci->ic_nchans); error = copyout(dc, ireq->i_data, IEEE80211_DEVCAPS_SPACE(dc)); free(dc, M_TEMP); |