strxfrm() returns an incorrect value on a short buffer

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Apr 13 08:10:00 GMT 2016


On Apr 13 10:46, Tony Cook wrote:
> On Tue, Apr 12, 2016 at 03:30:49PM +0200, Corinna Vinschen wrote:
> > On Apr 12 15:07, Tony Cook wrote:
> > > strxfrm() returns an incorrect value if you supply an output buffer
> > > and that buffer is too short for the result.
> > > 
> > > With the code following:
> > > [...]
> > > It appears that strxfrm() is just returning the size of the output
> > > buffer on an overflow error rather than calling LCMapString() again
> > > with cchDest set to zero to get the required buffer length that
> > > strxfrm() is meant to return on a short buffer.
> > 
> > Thanks for the testcase.  I applied a patch
> > 
> >   https://sourceware.org/git/?p=newlib-cygwin.git;h=e1854211
> > 
> > and created new snapshots on
> > 
> >   https://cygwin.com/snapshots/
> > 
> > Please give them a try.
> 
> Thanks, fixed in snapshot 20160412.

Thanks for your feedback,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20160413/9882f227/attachment.sig>


More information about the Cygwin mailing list