c0d7d3e1a2
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> |
||
---|---|---|
.. | ||
CVSChangeLogs.old | ||
cygserver | ||
cygwin | ||
doc | ||
lsaauth | ||
testsuite | ||
utils | ||
acinclude.m4 | ||
aclocal.m4 | ||
autogen.sh | ||
c++wrap | ||
ccwrap | ||
config.guess | ||
config.sub | ||
configure | ||
configure.ac | ||
configure.cygwin | ||
CONTRIBUTORS | ||
COPYING | ||
COPYING.LIB | ||
CYGWIN_LICENSE | ||
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