diff mbox series

WNM: Fix time_zone handling in mgmt frames

Message ID 20180528202646.13796-1-markus.theil@tu-ilmenau.de
State Accepted
Headers show
Series WNM: Fix time_zone handling in mgmt frames | expand

Commit Message

Markus Theil May 28, 2018, 8:26 p.m. UTC
If time_advertisement=2 in the config file and time_zone is unset,
the current code wants to write the time_zone eid into mgmt frames.
Without this patch, it fails with a SEGV on os_strlen(hapd->conf->time_zone).

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
---
 src/ap/ieee802_11_shared.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jouni Malinen May 31, 2018, 1:17 p.m. UTC | #1
On Mon, May 28, 2018 at 10:26:46PM +0200, Markus Theil wrote:
> If time_advertisement=2 in the config file and time_zone is unset,
> the current code wants to write the time_zone eid into mgmt frames.
> Without this patch, it fails with a SEGV on os_strlen(hapd->conf->time_zone).

Thanks, applied.
diff mbox series

Patch

diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c
index d3733c8eb..cd74cd9a4 100644
--- a/src/ap/ieee802_11_shared.c
+++ b/src/ap/ieee802_11_shared.c
@@ -449,6 +449,9 @@  u8 * hostapd_eid_time_zone(struct hostapd_data *hapd, u8 *eid)
 	if (hapd->conf->time_advertisement != 2)
 		return eid;
 
+	if (hapd->conf->time_zone == NULL)
+		return eid;
+
 	len = os_strlen(hapd->conf->time_zone);
 
 	*eid++ = WLAN_EID_TIME_ZONE;