]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FST: Do not replace previous attachment
authorJouni Malinen <j@w1.fi>
Sat, 25 Jul 2015 16:52:27 +0000 (19:52 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 25 Jul 2015 16:52:27 +0000 (19:52 +0300)
hapd->iface->fst must not be overridden if it is already pointing to FST
instance. Without this, duplicated FST-ATTACH could result in memory
leak and process termination.

Signed-off-by: Jouni Malinen <j@w1.fi>
hostapd/ctrl_iface.c

index aa803533cf332725f6d3e7a3f7b07efb1ec1013a..d2c78caddb0988722d0f0a022a1dbe4ae393f7c5 100644 (file)
@@ -2578,6 +2578,10 @@ hostapd_global_ctrl_iface_fst_attach(struct hapd_interfaces *interfaces,
        if (!fst_parse_attach_command(cmd, ifname, sizeof(ifname), &cfg)) {
                hapd = hostapd_get_iface(interfaces, ifname);
                if (hapd) {
+                       if (hapd->iface->fst) {
+                               wpa_printf(MSG_INFO, "FST: Already attached");
+                               return -1;
+                       }
                        fst_hostapd_fill_iface_obj(hapd, &iface_obj);
                        hapd->iface->fst = fst_attach(ifname, hapd->own_addr,
                                                      &iface_obj, &cfg);