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 <j@w1.fi>
intended-for: hostap-1
This commit is contained in:
Jouni Malinen 2012-06-27 18:19:29 +03:00
parent 99f0032409
commit 7be6dc2e96

View file

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