Index: nls.c =================================================================== --- nls.c (revision 59836) +++ nls.c (working copy) @@ -1464,7 +1464,7 @@ INT WideCharCount) { /* Check the parameters. */ - if (MultiByteString == NULL || + if (MultiByteString == NULL || MultiByteCount == 0 || (WideCharString == NULL && WideCharCount > 0) || (PVOID)MultiByteString == (PVOID)WideCharString) { @@ -1898,7 +1898,7 @@ LPBOOL UsedDefaultChar) { /* Check the parameters. */ - if (WideCharString == NULL || + if (WideCharString == NULL || WideCharCount == 0 || (MultiByteString == NULL && MultiByteCount > 0) || (PVOID)WideCharString == (PVOID)MultiByteString || MultiByteCount < 0) @@ -1916,6 +1916,11 @@ switch (CodePage) { case CP_UTF8: + if(DefaultChar != NULL || UsedDefaultChar != NULL) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } return IntWideCharToMultiByteUTF8(CodePage, Flags, WideCharString,