Skip to content

Commit

Permalink
Staging: wlan-ng: off by one in prism2mgmt_scan_results()
Browse files Browse the repository at this point in the history
Count is used to cap "req->bssindex.data" which is used as an offset
into the hw->scanresults->info.hscanresult.result[] array.  The array
has only HFA384x_SCANRESULT_MAX (31) elements so the 32 is off by one.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Apr 18, 2012
1 parent 0d19cd3 commit bb46f13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/wlan-ng/prism2mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
}

count = (hw->scanresults->framelen - 3) / 32;
if (count > 32)
count = 32;
if (count > HFA384x_SCANRESULT_MAX)
count = HFA384x_SCANRESULT_MAX;

if (req->bssindex.data >= count) {
pr_debug("requested index (%d) out of range (%d)\n",
Expand Down

0 comments on commit bb46f13

Please sign in to comment.