forwarded 581817 https://savannah.gnu.org/bugs/index.php?29898
tags 581817 + upstream
thanks

Hello Floriwan,

Am Sonntag, den 16.05.2010, 12:01 +0200 schrieb Florian Weimer:

> http_atotm() does not copy the terminating NUL character of the locale
> string.  The following patch should fix this.
> 
> (l < sizeof savedlocale holds at this point, so l is at most 254, and
> there is room for NUL character, if I'm not mistaken.)
> 
> It's probably easier to just use xstrdup, by the way.
> 
> commit 1182dcd947bc5718af6a1c797a79487607fcfc9f
> Author: Florian Weimer <[email protected]>
> Date:   Sun May 16 11:57:52 2010 +0200
> 
>     http_atotm(): also copy terminating NUL character
> 
> diff --git a/src/http.c b/src/http.c
> index 15e1caf..e7dc830 100644
> --- a/src/http.c
> +++ b/src/http.c
> @@ -2928,7 +2928,7 @@ http_atotm (const char *time_string)
>        if (l >= sizeof savedlocale)
>          savedlocale[0] = '\0';
>        else
> -        memcpy (savedlocale, oldlocale, l);
> +        memcpy (savedlocale, oldlocale, l + 1);
>      }
>    else savedlocale[0] = '\0';

Thanks for your report and patch.

I forwarded it to the upstream bugtracker.


-- 
Noèl Köthe <[email protected]>
Debian GNU/Linux, www.debian.org

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

Reply via email to