test: Use more consistent NULL checking for associate ssid parameter
This was checked once against NULL, but not on the following uses. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
bd27b1360f
commit
d12eb581f9
1 changed files with 10 additions and 5 deletions
|
@ -1529,6 +1529,7 @@ static int wpa_driver_test_associate(
|
|||
#endif /* DRIVER_TEST_UNIX */
|
||||
|
||||
if (params->mode == IEEE80211_MODE_AP) {
|
||||
if (params->ssid)
|
||||
os_memcpy(dbss->ssid, params->ssid, params->ssid_len);
|
||||
dbss->ssid_len = params->ssid_len;
|
||||
os_memcpy(dbss->bssid, drv->own_addr, ETH_ALEN);
|
||||
|
@ -1550,6 +1551,7 @@ static int wpa_driver_test_associate(
|
|||
MAC2STR(drv->own_addr));
|
||||
if (ret >= 0 && ret < end - pos)
|
||||
pos += ret;
|
||||
if (params->ssid)
|
||||
pos += wpa_snprintf_hex(pos, end - pos, params->ssid,
|
||||
params->ssid_len);
|
||||
ret = os_snprintf(pos, end - pos, " ");
|
||||
|
@ -1575,12 +1577,15 @@ static int wpa_driver_test_associate(
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (params->ssid)
|
||||
os_memcpy(dbss->ssid, params->ssid, params->ssid_len);
|
||||
dbss->ssid_len = params->ssid_len;
|
||||
} else {
|
||||
drv->associated = 1;
|
||||
if (params->mode == IEEE80211_MODE_IBSS) {
|
||||
os_memcpy(dbss->ssid, params->ssid, params->ssid_len);
|
||||
if (params->ssid)
|
||||
os_memcpy(dbss->ssid, params->ssid,
|
||||
params->ssid_len);
|
||||
dbss->ssid_len = params->ssid_len;
|
||||
if (params->bssid)
|
||||
os_memcpy(dbss->bssid, params->bssid,
|
||||
|
|
Loading…
Reference in a new issue