]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix the "BSS FIRST.." command
authorAmar Singhal <asinghal@qca.qualcomm.com>
Tue, 5 Feb 2013 22:28:48 +0000 (00:28 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 5 Feb 2013 22:28:48 +0000 (00:28 +0200)
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 <jouni@qca.qualcomm.com>

wpa_supplicant/ctrl_iface.c

index 2f2676c1a4ed1c9ed17b466f6aeb3b6ef8001278..8a5428ae31b8691b13bbc6d5dc4e5e76cd407029 100644 (file)
@@ -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);