diff --git a/src/wps/wps_upnp.c b/src/wps/wps_upnp.c index 6fb3d4c55..f62b49e60 100644 --- a/src/wps/wps_upnp.c +++ b/src/wps/wps_upnp.c @@ -227,6 +227,8 @@ void format_date(struct wpabuf *buf) t = time(NULL); date = gmtime(&t); + if (date == NULL) + return; wpabuf_printf(buf, "%s, %02d %s %d %02d:%02d:%02d GMT", &weekday_str[date->tm_wday * 4], date->tm_mday, &month_str[date->tm_mon * 4], date->tm_year + 1900,