bounds check each ie's length when parsing
Obtained from: madwifi MFC after: 1 week
This commit is contained in:
parent
03001f59c8
commit
336ec6a116
@ -1769,6 +1769,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
|
|||||||
scan.chan = scan.bchan;
|
scan.chan = scan.bchan;
|
||||||
|
|
||||||
while (frm < efrm) {
|
while (frm < efrm) {
|
||||||
|
IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1]);
|
||||||
switch (*frm) {
|
switch (*frm) {
|
||||||
case IEEE80211_ELEMID_SSID:
|
case IEEE80211_ELEMID_SSID:
|
||||||
scan.ssid = frm;
|
scan.ssid = frm;
|
||||||
@ -2001,6 +2002,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
|
|||||||
*/
|
*/
|
||||||
ssid = rates = xrates = NULL;
|
ssid = rates = xrates = NULL;
|
||||||
while (frm < efrm) {
|
while (frm < efrm) {
|
||||||
|
IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1]);
|
||||||
switch (*frm) {
|
switch (*frm) {
|
||||||
case IEEE80211_ELEMID_SSID:
|
case IEEE80211_ELEMID_SSID:
|
||||||
ssid = frm;
|
ssid = frm;
|
||||||
@ -2177,6 +2179,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
|
|||||||
frm += 6; /* ignore current AP info */
|
frm += 6; /* ignore current AP info */
|
||||||
ssid = rates = xrates = wpa = wme = NULL;
|
ssid = rates = xrates = wpa = wme = NULL;
|
||||||
while (frm < efrm) {
|
while (frm < efrm) {
|
||||||
|
IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1]);
|
||||||
switch (*frm) {
|
switch (*frm) {
|
||||||
case IEEE80211_ELEMID_SSID:
|
case IEEE80211_ELEMID_SSID:
|
||||||
ssid = frm;
|
ssid = frm;
|
||||||
@ -2381,6 +2384,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
|
|||||||
|
|
||||||
rates = xrates = wpa = wme = NULL;
|
rates = xrates = wpa = wme = NULL;
|
||||||
while (frm < efrm) {
|
while (frm < efrm) {
|
||||||
|
IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1]);
|
||||||
switch (*frm) {
|
switch (*frm) {
|
||||||
case IEEE80211_ELEMID_RATES:
|
case IEEE80211_ELEMID_RATES:
|
||||||
rates = frm;
|
rates = frm;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user