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.
This commit is contained in:
Jouni Malinen 2010-07-19 18:53:57 -07:00 committed by Jouni Malinen
parent 7f6ec672ea
commit 08b19cb404

View File

@ -1172,6 +1172,8 @@ wps_er_init(struct wps_context *wps, const char *ifname, const char *filter)
wps_er_deinit(er, NULL, NULL);
return NULL;
}
/* Limit event_id to < 32 bits to avoid issues with atoi() */
er->event_id &= 0x0fffffff;
if (filter) {
if (inet_aton(filter, &er->filter_addr) == 0) {