]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Fix time_zone advertisement without time_zone configuration
authorMarkus Theil <markus.theil@tu-ilmenau.de>
Mon, 28 May 2018 20:26:46 +0000 (22:26 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 31 May 2018 09:53:43 +0000 (12:53 +0300)
If time_advertisement=2 is included in hostapd configuration, but
time_zone is unset, the previous implementation tried to write the Time
Zone element into management frames. This resulted in segmentation fault
when trying to dereference a NULL pointer. Fix that by skipping addition
of this element when time_zone parameter is not set.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
src/ap/ieee802_11_shared.c

index d3733c8eb496bec5f8a4d8798f0136d2d1ab0282..a3f860992effa3f070ee5d21680b3b6c2cfc42ae 100644 (file)
@@ -446,7 +446,7 @@ u8 * hostapd_eid_time_zone(struct hostapd_data *hapd, u8 *eid)
 {
        size_t len;
 
-       if (hapd->conf->time_advertisement != 2)
+       if (hapd->conf->time_advertisement != 2 || !hapd->conf->time_zone)
                return eid;
 
        len = os_strlen(hapd->conf->time_zone);