mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
c5158963a3
The code was trying to check whether the output string was already NULL terminated by RtlUnicodeToMultiByteN before NULL terminating it by checking DataStr[*count - 1] for a NULL terminator. But since RtlUnicodeToMultiByteSize always returns the size without the NULL terminator, DataStr[*count - 1] would always be the last actual character, never an optional NULL terminator. For 0 sized strings this would actually lead to accessing the output buffer at position -1 (on 32 bit) or 0xFFFFFFFF (on 64 bit). Fix this by removing the check. This fixes a crash in advapi32_winetest:registry on x64. |
||
---|---|---|
.. | ||
misc | ||
reg | ||
sec | ||
service | ||
token | ||
wine | ||
advapi32.h | ||
advapi32.rc | ||
advapi32.spec | ||
CMakeLists.txt |