From: Andrei Otcheretianski Date: Mon, 19 Oct 2020 08:06:29 +0000 (+0300) Subject: wpa_supplicant: Remove unfeasible conditions in config parsing X-Git-Tag: hostap_2_10~808 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4c7114cf54a83570140d58d591018a8812d26be;p=thirdparty%2Fhostap.git wpa_supplicant: Remove unfeasible conditions in config parsing pos can't be NULL in wpa_global_config_parse_str(), so there is no point checking this, especially when pos was already dereferenced earlier. Remove the redundant conditions. Signed-off-by: Andrei Otcheretianski --- diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index e8c4d05a4..c5161544d 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -4469,9 +4469,7 @@ static int wpa_global_config_parse_str(const struct global_parse_data *data, prev_len = 0; /* No change to the previously configured value */ - if ((!(*dst) && !pos) || - (*dst && pos && prev_len == len && - os_memcmp(*dst, pos, len) == 0)) + if (*dst && prev_len == len && os_memcmp(*dst, pos, len) == 0) return 1; tmp = os_strdup(pos);