From: Jouni Malinen Date: Wed, 27 Jun 2012 15:19:29 +0000 (+0300) Subject: WPS: Fix NFC password token building with WPS 2.0 X-Git-Tag: hostap_2_0~592 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7be6dc2e96f160743a8db0fb7bc62cd713a00c7c;p=thirdparty%2Fhostap.git WPS: Fix NFC password token building with WPS 2.0 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 intended-for: hostap-1 --- diff --git a/src/wps/wps_common.c b/src/wps/wps_common.c index 2dff4b254..20e0824e2 100644 --- a/src/wps/wps_common.c +++ b/src/wps/wps_common.c @@ -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");