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>
This commit is contained in:
parent
5a3a131993
commit
2fae58fdc1
1 changed files with 2 additions and 0 deletions
|
@ -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…
Reference in a new issue