|
@@ -361,11 +361,17 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
|
|
|
hs20 = wpabuf_alloc(20);
|
|
|
if (hs20) {
|
|
|
int pps_mo_id = hs20_get_pps_mo_id(wpa_s, ssid);
|
|
|
+ size_t len;
|
|
|
+
|
|
|
wpas_hs20_add_indication(hs20, pps_mo_id);
|
|
|
- os_memcpy(wpa_s->sme.assoc_req_ie +
|
|
|
- wpa_s->sme.assoc_req_ie_len,
|
|
|
- wpabuf_head(hs20), wpabuf_len(hs20));
|
|
|
- wpa_s->sme.assoc_req_ie_len += wpabuf_len(hs20);
|
|
|
+ len = sizeof(wpa_s->sme.assoc_req_ie) -
|
|
|
+ wpa_s->sme.assoc_req_ie_len;
|
|
|
+ if (wpabuf_len(hs20) <= len) {
|
|
|
+ os_memcpy(wpa_s->sme.assoc_req_ie +
|
|
|
+ wpa_s->sme.assoc_req_ie_len,
|
|
|
+ wpabuf_head(hs20), wpabuf_len(hs20));
|
|
|
+ wpa_s->sme.assoc_req_ie_len += wpabuf_len(hs20);
|
|
|
+ }
|
|
|
wpabuf_free(hs20);
|
|
|
}
|
|
|
}
|