From 493ba877c3057d8246d982911a87754e1cf41b19 Mon Sep 17 00:00:00 2001 From: Marek Kwaczynski Date: Fri, 13 Dec 2013 10:32:36 +0100 Subject: [PATCH] hostapd: Clear interface_added flag on error path If more BSSes are added in config file than are supported by the driver, segmentation fault can appear. For this case, the interface_added flag needs to be cleared if adding a new BSS fails. Signed-hostap: Marek Kwaczynski --- src/ap/hostapd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 6fe295609..a436c2aec 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -667,6 +667,7 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) NULL, first == -1)) { wpa_printf(MSG_ERROR, "Failed to add BSS (BSSID=" MACSTR ")", MAC2STR(hapd->own_addr)); + hapd->interface_added = 0; return -1; } }