]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Fix configuration strings on config reload
authorJouni Malinen <jouni.malinen@atheros.com>
Tue, 6 Jul 2010 23:32:55 +0000 (16:32 -0700)
committerJouni Malinen <j@w1.fi>
Thu, 9 Sep 2010 14:17:20 +0000 (07:17 -0700)
Previously, freed memory could be used as device name (and other similar
parameters) when building WPS IE after SIGHUP.

wpa_supplicant/wps_supplicant.c

index 8f5329ad3aa957d53be8de48ad32a61f8018569f..9ded028c7aadc9c500942d0e8c4fbf02773b92c4 100644 (file)
@@ -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;
+       }
 }