change null_getradiocaps to return the actual count of channels instead
of the true number; otherwise the caller may use the count to do things with the data it should not (e.g. sort the channel table)
This commit is contained in:
parent
49cfcf2ff6
commit
dce44e3d8e
@ -48,10 +48,10 @@ null_getradiocaps(struct ieee80211com *ic, int maxchan,
|
||||
int *n, struct ieee80211_channel *c)
|
||||
{
|
||||
/* just feed back the current channel list */
|
||||
*n = ic->ic_nchans; /* XXX return count copied? */
|
||||
if (maxchan > ic->ic_nchans)
|
||||
maxchan = ic->ic_nchans;
|
||||
memcpy(c, ic->ic_channels, maxchan*sizeof(struct ieee80211_channel));
|
||||
*n = maxchan;
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user