mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 08:48:31 -05:00
WPS: Check for theoretical gmtime() failure
In theory, gmtime() could return NULL if the year value would not fit into an integer. However, that cannot really happen with the current time() value in practice. Anyway, clean up static analyzer reports by checking for this corner case. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
d75a5ae018
commit
86388afa56
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user