From: Jouni Malinen Date: Mon, 18 Feb 2019 16:24:52 +0000 (+0200) Subject: Fix wpa_psk_file parser error case handling X-Git-Tag: hostap_2_8~350 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fae58fdc14219f1b86ed8bcea04f97ce6c943ca;p=thirdparty%2Fhostap.git 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: ec5c39a5574d ("AP: Allow identifying which passphrase station used with wpa_psk_file") Signed-off-by: Jouni Malinen --- diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c index 89ba399e9..11475b6e0 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -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 = "";