]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Remove unfeasible conditions in config parsing
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Mon, 19 Oct 2020 08:06:29 +0000 (11:06 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 19 Oct 2020 20:05:33 +0000 (23:05 +0300)
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 <andrei.otcheretianski@intel.com>
wpa_supplicant/config.c

index e8c4d05a475a6414acff27666d20e7a0f45456e1..c5161544db0dcf407de1bc9c8b554a9bc11c006c 100644 (file)
@@ -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);