aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-07-20 01:53:57 (GMT)
committerJouni Malinen <j@w1.fi>2010-07-21 05:58:57 (GMT)
commit4fcd811d508750d028c959db0753c57c2c4f3e42 (patch)
tree040bab6b49cdf885d69fcbe81b11d33dbdd07b12
parent9a3e19d985801c4b8e057acb792bc95a3c5fe824 (diff)
downloadhostap-07-4fcd811d508750d028c959db0753c57c2c4f3e42.zip
hostap-07-4fcd811d508750d028c959db0753c57c2c4f3e42.tar.gz
hostap-07-4fcd811d508750d028c959db0753c57c2c4f3e42.tar.bz2
WPS: Limit WPS ER event_id < 2^31 bits to avoid issues with atoi()
Previously, large event_id values (> 2^31) resulted in integer overflow that would make ER drop all events from the AP. (cherry picked from commit 08b19cb4049655f7a0703bbfb994ddf4c64f7276)
-rw-r--r--src/wps/wps_er.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wps/wps_er.c b/src/wps/wps_er.c
index d750ecd..e0cdd1d 100644
--- a/src/wps/wps_er.c
+++ b/src/wps/wps_er.c
@@ -1172,6 +1172,8 @@ wps_er_init(struct wps_context *wps, const char *ifname)
wps_er_deinit(er, NULL, NULL);
return NULL;
}
+ /* Limit event_id to < 32 bits to avoid issues with atoi() */
+ er->event_id &= 0x0fffffff;
if (get_netif_info(ifname, &er->ip_addr, &er->ip_addr_text,
er->mac_addr)) {