]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
GAS: Fix OSU Providers List response with invalid configuration
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 7 Feb 2017 15:46:29 +0000 (17:46 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 7 Feb 2017 15:47:58 +0000 (17:47 +0200)
If the OSU Providers configuration was invalid (included osu_server_uri
but not osu_method_list), it was possible for the GAS response
generation to hit a NULL dereference. Fix this by checking for the
invalid configuration before trying to fill in the OSU methods.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/ap/gas_serv.c

index 95f0a667e57d5b86ba224eb6cbccc4b37b285362..96cd7030a102826984a1f22563adf040343855f0 100644 (file)
@@ -691,7 +691,7 @@ static void anqp_add_osu_provider(struct wpabuf *buf,
 
        /* OSU Method List */
        count = wpabuf_put(buf, 1);
-       for (i = 0; p->method_list[i] >= 0; i++)
+       for (i = 0; p->method_list && p->method_list[i] >= 0; i++)
                wpabuf_put_u8(buf, p->method_list[i]);
        *count = i;