bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: %.1s format with vasnprintf reads more than one byte from argument


From: Eric Blake
Subject: Re: %.1s format with vasnprintf reads more than one byte from argument
Date: Wed, 25 Feb 2009 17:49:17 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Bruno Haible <bruno <at> clisp.org> writes:

> 
> There is also a more complicated case: when a %ls directive occurs
> in a char* format string, or a %s directive in a wchar_t* format string.
> In these two cases, the only robust fix that I see is to implement the
> entire handling of this directive ourselves. I'm applying this:
> 
> 2009-02-23  Bruno Haible  <bruno <at> clisp.org>
> 
>       Fix invalid read past end of memory block.

This patch introduced a regression on OpenBSD (I'm not sure if it is the same 
failure as Gary's report of -0.0 difficulties).

git reset --hard e8e63^
./gnulib-tool --with-tests --test vasprintf-posix

passes, but 

git reset --hard e8e63
./gnulib-tool --with-tests --test vasprintf-posix

fails:

../../gltests/test-vasprintf-posix.c:3624: assertion failed
Abort trap 
FAIL: test-vasprintf-posix


In the debugger, I see that vasprintf(&result,"%.*ls",2,L"ab") is setting 
result to "a", not the expected "ab".

-- 
Eric Blake






reply via email to

[Prev in Thread] Current Thread [Next in Thread]