Browse Source

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
Jouni Malinen 12 years ago
parent
commit
7be6dc2e96
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/wps/wps_common.c

+ 1 - 1
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");