diff options
author | Jouni Malinen <j@w1.fi> | 2008-11-29 21:12:12 +0200 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2008-11-29 21:12:12 +0200 |
commit | 43fb17940fd9097c9739c602e2dce9797b9d4be6 (patch) | |
tree | 2dd1b4bf4fce95e305e509aabff3dc65a0036931 /hostapd | |
parent | 23f53f2a8174ddae48c54c2df98e5362144bdffb (diff) | |
download | external_wpa_supplicant_8_ti-43fb17940fd9097c9739c602e2dce9797b9d4be6.zip external_wpa_supplicant_8_ti-43fb17940fd9097c9739c602e2dce9797b9d4be6.tar.gz external_wpa_supplicant_8_ti-43fb17940fd9097c9739c602e2dce9797b9d4be6.tar.bz2 |
WPS: Fixed hostapd to use allocated buffers for device attributes
Previous version did not handle re-configuration correctly since WPS
context data was pointing to old (now freed) strings.
Diffstat (limited to 'hostapd')
-rw-r--r-- | hostapd/wps_hostapd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/hostapd/wps_hostapd.c b/hostapd/wps_hostapd.c index 28eec4a..76258ee 100644 --- a/hostapd/wps_hostapd.c +++ b/hostapd/wps_hostapd.c @@ -388,11 +388,11 @@ int hostapd_init_wps(struct hostapd_data *hapd, os_memcpy(wps->ssid, hapd->conf->ssid.ssid, wps->ssid_len); wps->ap = 1; os_memcpy(wps->dev.mac_addr, hapd->own_addr, ETH_ALEN); - wps->dev.device_name = hapd->conf->device_name; - wps->dev.manufacturer = hapd->conf->manufacturer; - wps->dev.model_name = hapd->conf->model_name; - wps->dev.model_number = hapd->conf->model_number; - wps->dev.serial_number = hapd->conf->serial_number; + wps->dev.device_name = os_strdup(hapd->conf->device_name); + wps->dev.manufacturer = os_strdup(hapd->conf->manufacturer); + wps->dev.model_name = os_strdup(hapd->conf->model_name); + wps->dev.model_number = os_strdup(hapd->conf->model_number); + wps->dev.serial_number = os_strdup(hapd->conf->serial_number); if (hapd->conf->config_methods) { char *m = hapd->conf->config_methods; if (os_strstr(m, "label")) @@ -532,6 +532,7 @@ void hostapd_deinit_wps(struct hostapd_data *hapd) return; wps_registrar_deinit(hapd->wps->registrar); os_free(hapd->wps->network_key); + wps_device_data_free(&hapd->wps->dev); os_free(hapd->wps); hapd->wps = NULL; hostapd_wps_clear_ies(hapd); |