lib/fetch/http.c: buffer not NUL terminated (CID 62666)

This commit is contained in:
Juan RP 2014-10-05 09:04:16 +02:00
parent 691cd26482
commit 9d90c75fcc

View File

@ -519,7 +519,8 @@ http_parse_mtime(const char *p, time_t *mtime)
char locale[64], *r;
struct tm tm;
strncpy(locale, setlocale(LC_TIME, NULL), sizeof(locale));
strncpy(locale, setlocale(LC_TIME, NULL), sizeof(locale)-1);
locale[sizeof(locale)-1] = '\0';
setlocale(LC_TIME, "C");
r = strptime(p, "%a, %d %b %Y %H:%M:%S GMT", &tm);
/* XXX should add support for date-2 and date-3 */