Instead of pointing at an external memory location that might get
invalidated (e.g., by being actually in stack instead of long term heap
allocation as seems to be the case in src/p2p/p2p.c), allocate a copy of
the list PASN groups into struct pasn_data.
Signed-off-by: Jouni Malinen <jouni.malinen@oss.qualcomm.com>
pasn_set_peer_addr(pasn, sta->addr);
pasn_set_wpa_key_mgmt(pasn, hapd->conf->wpa_key_mgmt);
pasn_set_rsn_pairwise(pasn, hapd->conf->rsn_pairwise);
- pasn->pasn_groups = hapd->conf->pasn_groups;
+ os_free(pasn->pasn_groups);
+ pasn->pasn_groups = int_array_dup(hapd->conf->pasn_groups);
pasn->noauth = hapd->conf->pasn_noauth;
if (hapd->iface->drv_flags2 & WPA_DRIVER_FLAGS2_SEC_LTF_AP)
pasn_enable_kdk_derivation(pasn);
} else {
pasn_groups[0] = 19;
}
- pasn->pasn_groups = pasn_groups;
+ os_free(pasn->pasn_groups);
+ pasn->pasn_groups = int_array_dup(pasn_groups);
if (p2p_pasn_handle_action_wrapper(p2p, dev, mgmt, len, freq,
auth_transaction)) {
return;
os_free(pasn->rsnxe_ie);
wpabuf_free(pasn->frame);
+ os_free(pasn->pasn_groups);
bin_clear_free(pasn, sizeof(struct pasn_data));
}