]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Limit WPS ER event_id < 2^31 bits to avoid issues with atoi()
authorJouni Malinen <jouni.malinen@atheros.com>
Tue, 20 Jul 2010 01:53:57 +0000 (18:53 -0700)
committerJouni Malinen <j@w1.fi>
Wed, 21 Jul 2010 05:56:58 +0000 (22:56 -0700)
Previously, large event_id values (> 2^31) resulted in integer
overflow that would make ER drop all events from the AP.

src/wps/wps_er.c

index 9c47aafcf218b415f513664a3986cdbde4cb20ee..6d7455e2eee32999408e61437b2bbddbd46cc856 100644 (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) {