From 84b2d525986764c1bfba8e21627edb7b37de51a8 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sun, 23 May 2010 10:58:05 +0200 Subject: [PATCH] http_atotm copies the NUL character of the locale string. --- src/ChangeLog | 6 ++++++ src/http.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 03b6ecdf..07411a2a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-05-23 Giuseppe Scrivano + + * http.c (http_atotm): Count the NUL character when copying the locale + string. + Reported by: Florian Weimer + 2010-05-16 Giuseppe Scrivano * Makefile.am (LDADD): Remove MD5_LDADD. diff --git a/src/http.c b/src/http.c index 1109e994..c5aa8ea0 100644 --- a/src/http.c +++ b/src/http.c @@ -3203,7 +3203,7 @@ http_atotm (const char *time_string) oldlocale = setlocale (LC_TIME, NULL); if (oldlocale) { - size_t l = strlen (oldlocale); + size_t l = strlen (oldlocale) + 1; if (l >= sizeof savedlocale) savedlocale[0] = '\0'; else -- 2.39.2