fail as documented when the pointer to the buffer equals the pointer to the string...
authorThomas Bluemel <thomas@reactsoft.com>
Wed, 3 Aug 2005 23:07:10 +0000 (23:07 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Wed, 3 Aug 2005 23:07:10 +0000 (23:07 +0000)
svn path=/trunk/; revision=17039

reactos/lib/kernel32/misc/nls.c

index da88fd7..30fde3b 100755 (executable)
@@ -745,7 +745,8 @@ MultiByteToWideChar(UINT CodePage, DWORD Flags,
 {
    /* Check the parameters. */
    if (MultiByteString == NULL ||
-       (WideCharString == NULL && WideCharCount > 0))
+       (WideCharString == NULL && WideCharCount > 0) ||
+       (PVOID)MultiByteString == (PVOID)WideCharString)
    {
       SetLastError(ERROR_INVALID_PARAMETER);
       return 0;
@@ -823,7 +824,8 @@ WideCharToMultiByte(UINT CodePage, DWORD Flags,
 {
    /* Check the parameters. */
    if (WideCharString == NULL ||
-       (MultiByteString == NULL && MultiByteCount > 0))
+       (MultiByteString == NULL && MultiByteCount > 0) ||
+       (PVOID)WideCharString == (PVOID)MultiByteString)
    {
       SetLastError(ERROR_INVALID_PARAMETER);
       return 0;