newlib/winsup
Corinna Vinschen c0d7d3e1a2 cygwin wcsxfrm: byte swap result ourselves
Workaround a bug (or undocumented behaviour) in LCMapStringW:

It's documented(*) that the cchDest parameter is a byte count with
LCMAP_SORTKEY, but a character count otherwise.  But the docs don't
state what happens if you combine LCMAP_SORTKEY with LCMAP_BYTEREV.

Tests indicate that LCMAP_SORTKEY treats cchDest as byte count, but
then LCMAP_BYTEREV treats it as char count in the same call.  So the
latter swaps twice as much bytes in the destination buffer than the
byte count it returns, which potentially results in writing past the
end of the given output buffer.

Solution: Don't specify LCMAP_BYTEREV in the LCMapStringW(LCMAP_SORTKEY)
call, rather byte swap afterwards.

(*) https://msdn.microsoft.com/en-us/library/windows/desktop/dd318702(v=vs.85).aspx

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-06-06 18:27:47 +02:00
..
CVSChangeLogs.old
cygserver cygserver: Speed up non-debug scenario 2017-03-24 17:55:36 +01:00
cygwin cygwin wcsxfrm: byte swap result ourselves 2017-06-06 18:27:47 +02:00
doc cygwin doc: Add postinstall/preremove scripts to install Start Menu entries 2017-04-22 14:02:33 +02:00
lsaauth
testsuite
utils strace: Fix "over-optimization" flaw in strace. 2017-04-19 20:17:04 +02:00
acinclude.m4
aclocal.m4
autogen.sh
c++wrap
ccwrap
config.guess
config.sub
configure
configure.ac
configure.cygwin
CONTRIBUTORS cygwin CONTRIBUTORS: Add Daniel Santos 2017-04-25 14:26:36 +02:00
COPYING
COPYING.LIB
CYGWIN_LICENSE Clarify source file license in CYGWIN_LICENSE 2016-06-23 21:52:12 +02:00
install-sh
Makefile.common
Makefile.in
README

THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESSED OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Cygwin documentation is available on the net at https://cygwin.com
You might especially be interested in

https://cygwin.com/faq/faq.html#faq.programming.building-cygwin