]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix hostapd error path regression
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 7 Mar 2014 20:37:03 +0000 (22:37 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 7 Mar 2014 20:37:03 +0000 (22:37 +0200)
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>
hostapd/main.c

index 68bc9b58204294b7496e6ed4a6fadf8476a03105..a9d7da5115d7c49444cd2b9277e544955174a8f4 100644 (file)
@@ -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);