mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 06:51:22 +00:00
[KERNEL32]
* Check more parameters in MultiByteToWideChar() and WideCharToMultibyte(). By Marcus Boillat. * Fixes 4 kernel32:codepage tests. CORE-7411 #resolve #comment Committed in r59839 with formatting fixes. Thanks. svn path=/trunk/; revision=59839
This commit is contained in:
parent
08c5f648ed
commit
003dacb551
1 changed files with 7 additions and 0 deletions
|
@ -1465,6 +1465,7 @@ MultiByteToWideChar(UINT CodePage,
|
||||||
{
|
{
|
||||||
/* Check the parameters. */
|
/* Check the parameters. */
|
||||||
if (MultiByteString == NULL ||
|
if (MultiByteString == NULL ||
|
||||||
|
MultiByteCount == 0 ||
|
||||||
(WideCharString == NULL && WideCharCount > 0) ||
|
(WideCharString == NULL && WideCharCount > 0) ||
|
||||||
(PVOID)MultiByteString == (PVOID)WideCharString)
|
(PVOID)MultiByteString == (PVOID)WideCharString)
|
||||||
{
|
{
|
||||||
|
@ -1899,6 +1900,7 @@ WideCharToMultiByte(UINT CodePage,
|
||||||
{
|
{
|
||||||
/* Check the parameters. */
|
/* Check the parameters. */
|
||||||
if (WideCharString == NULL ||
|
if (WideCharString == NULL ||
|
||||||
|
WideCharCount == 0 ||
|
||||||
(MultiByteString == NULL && MultiByteCount > 0) ||
|
(MultiByteString == NULL && MultiByteCount > 0) ||
|
||||||
(PVOID)WideCharString == (PVOID)MultiByteString ||
|
(PVOID)WideCharString == (PVOID)MultiByteString ||
|
||||||
MultiByteCount < 0)
|
MultiByteCount < 0)
|
||||||
|
@ -1916,6 +1918,11 @@ WideCharToMultiByte(UINT CodePage,
|
||||||
switch (CodePage)
|
switch (CodePage)
|
||||||
{
|
{
|
||||||
case CP_UTF8:
|
case CP_UTF8:
|
||||||
|
if (DefaultChar != NULL || UsedDefaultChar != NULL)
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return IntWideCharToMultiByteUTF8(CodePage,
|
return IntWideCharToMultiByteUTF8(CodePage,
|
||||||
Flags,
|
Flags,
|
||||||
WideCharString,
|
WideCharString,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue