From: Jouni Malinen Date: Tue, 20 Jul 2010 01:53:57 +0000 (-0700) Subject: WPS: Limit WPS ER event_id < 2^31 bits to avoid issues with atoi() X-Git-Tag: hostap-1-bp~1245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08b19cb4049655f7a0703bbfb994ddf4c64f7276;p=thirdparty%2Fhostap.git 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. --- diff --git a/src/wps/wps_er.c b/src/wps/wps_er.c index 9c47aafcf..6d7455e2e 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, 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) {