Fix wpa_psk_file parser error case handling

str_token() can return NULL for the name if the remaining token contains
only the delimiter. Fix this to avoid NULL pointer dereference with a
corner case of an invalid value used in the configuration.

Fixes: ec5c39a557 ("AP: Allow identifying which passphrase station used with wpa_psk_file")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
master
Jouni Malinen 5 years ago committed by Jouni Malinen
parent 5a3a131993
commit 2fae58fdc1

@ -303,6 +303,8 @@ static int hostapd_config_read_wpa_psk(const char *fname,
break;
context2 = NULL;
name = str_token(token, "=", &context2);
if (!name)
break;
value = str_token(token, "", &context2);
if (!value)
value = "";

Loading…
Cancel
Save