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: Thu, 26 Feb 2009 19:49:29 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bruno Haible on 2/26/2009 6:13 PM:
> 
> I removed the part of the test that should normally always fail:
>     if (sprintf (buf, "%ls", wstring) != -1)
>       return 2;
> because it does not fail on any known platform.

Actually, it DOES fail, on cygwin 1.7.0.  But that is due to a bug in
cygwin wctomb[1], which will hopefully be fixed soon, and not to sprintf
accessing too far in the wchar_t array, as the %.2ls test passes.

[1]http://cygwin.com/ml/cygwin/2009-02/msg00656.html

> Then refactored the code
> to keep different tests separate. Added comments and updated the doc:

Thanks.  I knew my patch was only a starter.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmnVLkACgkQ84KuGfSFAYBdoACfee6zia/S7v8ulKo8OYIv9MZT
f8wAnRoQ7ZI1STXSwR4S0YMXOoXndCaZ
=BGwM
-----END PGP SIGNATURE-----




reply via email to

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