[PATCH] wpa_supplicant: remove unfeasible conditions in config parsing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 wpa_supplicant/config.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index e8c4d05a47..74157da617 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -4469,9 +4469,8 @@ 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);
-- 
2.28.0


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux