Allow WPS device strings to be unconfigured
Previous version was causing a NULL pointer dereference if a required string was not set in configuration. It is better to make these optional.
This commit is contained in:
parent
b3ddab2122
commit
401e039633
1 changed files with 10 additions and 5 deletions
|
@ -421,11 +421,16 @@ int hostapd_init_wps(struct hostapd_data *hapd,
|
||||||
os_memcpy(wps->ssid, hapd->conf->ssid.ssid, wps->ssid_len);
|
os_memcpy(wps->ssid, hapd->conf->ssid.ssid, wps->ssid_len);
|
||||||
wps->ap = 1;
|
wps->ap = 1;
|
||||||
os_memcpy(wps->dev.mac_addr, hapd->own_addr, ETH_ALEN);
|
os_memcpy(wps->dev.mac_addr, hapd->own_addr, ETH_ALEN);
|
||||||
wps->dev.device_name = os_strdup(hapd->conf->device_name);
|
wps->dev.device_name = hapd->conf->device_name ?
|
||||||
wps->dev.manufacturer = os_strdup(hapd->conf->manufacturer);
|
os_strdup(hapd->conf->device_name) : NULL;
|
||||||
wps->dev.model_name = os_strdup(hapd->conf->model_name);
|
wps->dev.manufacturer = hapd->conf->manufacturer ?
|
||||||
wps->dev.model_number = os_strdup(hapd->conf->model_number);
|
os_strdup(hapd->conf->manufacturer) : NULL;
|
||||||
wps->dev.serial_number = os_strdup(hapd->conf->serial_number);
|
wps->dev.model_name = hapd->conf->model_name ?
|
||||||
|
os_strdup(hapd->conf->model_name) : NULL;
|
||||||
|
wps->dev.model_number = hapd->conf->model_number ?
|
||||||
|
os_strdup(hapd->conf->model_number) : NULL;
|
||||||
|
wps->dev.serial_number = hapd->conf->serial_number ?
|
||||||
|
os_strdup(hapd->conf->serial_number) : NULL;
|
||||||
if (hapd->conf->config_methods) {
|
if (hapd->conf->config_methods) {
|
||||||
char *m = hapd->conf->config_methods;
|
char *m = hapd->conf->config_methods;
|
||||||
if (os_strstr(m, "label"))
|
if (os_strstr(m, "label"))
|
||||||
|
|
Loading…
Reference in a new issue