From: Amar Singhal Date: Tue, 5 Feb 2013 22:28:48 +0000 (+0200) Subject: Fix the "BSS FIRST.." command X-Git-Tag: aosp-kk-from-upstream~596 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f330b4b44b6244cc818aac450c61f583775a606d;p=thirdparty%2Fhostap.git Fix the "BSS FIRST.." command The "BSS FIRST.." command fails when additional parameters (e.g., MASK) is used since the string comparsion does not take into account the number of characters. Fix by comparing only 5 characters as in other commands. Signed-hostap: Jouni Malinen --- diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 2f2676c1a..8a5428ae3 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -3173,7 +3173,7 @@ static int wpa_supplicant_ctrl_iface_bss(struct wpa_supplicant *wpa_s, } } } - } else if (os_strcmp(cmd, "FIRST") == 0) + } else if (os_strncmp(cmd, "FIRST", 5) == 0) bss = dl_list_first(&wpa_s->bss_id, struct wpa_bss, list_id); else if (os_strncmp(cmd, "ID-", 3) == 0) { i = atoi(cmd + 3);