]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Check wps_build_wfa_ext() return value consistently (CID 68104)
authorJouni Malinen <j@w1.fi>
Fri, 13 Jun 2014 22:05:18 +0000 (01:05 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 14 Jun 2014 09:32:52 +0000 (12:32 +0300)
While this call cannot really fail, check the return value to be more
consistent with all the other wps_build_wfa_ext() calls.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/wps/wps_upnp.c

index f62b49e60bc0115c3f2f300fb939abb4dce46843..ae94a9f62cc85124de30d4de2486468959f7ecda 100644 (file)
@@ -596,7 +596,10 @@ static struct wpabuf * build_fake_wsc_ack(void)
        wpabuf_put_be16(msg, ATTR_REGISTRAR_NONCE);
        wpabuf_put_be16(msg, WPS_NONCE_LEN);
        wpabuf_put(msg, WPS_NONCE_LEN);
-       wps_build_wfa_ext(msg, 0, NULL, 0);
+       if (wps_build_wfa_ext(msg, 0, NULL, 0)) {
+               wpabuf_free(msg);
+               return NULL;
+       }
        return msg;
 }