aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/main.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2014-03-07 20:37:03 (GMT)
committerJouni Malinen <j@w1.fi>2014-03-07 20:37:03 (GMT)
commit49021c1cb62456d5ec4eec4b2e2431c0b8c0890b (patch)
tree970a1bbd44ce366f0d4ca1d5a001e8a75d324588 /hostapd/main.c
parentc16a7590cfe76d5895ac70ef711e5b0b384f7aa6 (diff)
downloadhostap-49021c1cb62456d5ec4eec4b2e2431c0b8c0890b.zip
hostap-49021c1cb62456d5ec4eec4b2e2431c0b8c0890b.tar.gz
hostap-49021c1cb62456d5ec4eec4b2e2431c0b8c0890b.tar.bz2
Fix hostapd error path regression
Commit 354c903f8e47ae0fb41fb54ecc018e61d9573506 added setting of driver_ap_teardown on the hostapd exit path without taking into account that this may also be called on an error path where the interface has not been initialized. Fix the resulting NULL pointer dereference to allow hostapd to exit cleanly in error case. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'hostapd/main.c')
-rw-r--r--hostapd/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hostapd/main.c b/hostapd/main.c
index 68bc9b5..a9d7da5 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -729,6 +729,8 @@ int main(int argc, char *argv[])
hostapd_global_ctrl_iface_deinit(&interfaces);
/* Deinitialize all interfaces */
for (i = 0; i < interfaces.count; i++) {
+ if (!interfaces.iface[i])
+ continue;
interfaces.iface[i]->driver_ap_teardown =
!!(interfaces.iface[i]->drv_flags &
WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT);