From dcf788d1a45310da72ece64edf39e40dae020f9b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 6 Jul 2010 16:32:55 -0700 Subject: [PATCH] WPS: Fix configuration strings on config reload Previously, freed memory could be used as device name (and other similar parameters) when building WPS IE after SIGHUP. --- wpa_supplicant/wps_supplicant.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c index 8f5329ad3..9ded028c7 100644 --- a/wpa_supplicant/wps_supplicant.c +++ b/wpa_supplicant/wps_supplicant.c @@ -1386,4 +1386,13 @@ void wpas_wps_update_config(struct wpa_supplicant *wpa_s) } else os_memcpy(wps->uuid, wpa_s->conf->uuid, WPS_UUID_LEN); } + + if (wpa_s->conf->changed_parameters & CFG_CHANGED_DEVICE_NAME) { + /* Update pointers to make sure they refer current values */ + wps->dev.device_name = wpa_s->conf->device_name; + wps->dev.manufacturer = wpa_s->conf->manufacturer; + wps->dev.model_name = wpa_s->conf->model_name; + wps->dev.model_number = wpa_s->conf->model_number; + wps->dev.serial_number = wpa_s->conf->serial_number; + } }