]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Fix NFC password token building with WPS 2.0
authorJouni Malinen <j@w1.fi>
Wed, 27 Jun 2012 15:19:29 +0000 (18:19 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 27 Jun 2012 18:21:11 +0000 (21:21 +0300)
The earlier WPS 2.0 changes did not increase the wpabuf size when
adding a new attribute to the NFC password token. This could result
in aborting the application on wpabuf overflow if NFC out-of-band
mechanism is used with WPS 2.0 enabled.

Signed-hostap: Jouni Malinen <j@w1.fi>
intended-for: hostap-1

src/wps/wps_common.c

index 2dff4b254e17a2ad0c7cb3eb920933b4e97a3c0a..20e0824e2f4a51688855f21254c67c16b0884835 100644 (file)
@@ -339,7 +339,7 @@ static struct wpabuf * wps_get_oob_dev_pwd(struct wps_context *wps)
 {
        struct wpabuf *data;
 
-       data = wpabuf_alloc(9 + WPS_OOB_DEVICE_PASSWORD_ATTR_LEN);
+       data = wpabuf_alloc(200);
        if (data == NULL) {
                wpa_printf(MSG_ERROR, "WPS: Failed to allocate memory for OOB "
                           "device password attribute");