Added NULL pointer checks.

This commit is contained in:
Wolfgang Schwotzer 2000-07-28 23:58:48 +00:00 committed by Alexandre Julliard
parent 5b6879c5c0
commit d9b8f9be37
1 changed files with 12 additions and 0 deletions

View File

@ -246,6 +246,12 @@ INT WINAPI MultiByteToWideChar( UINT page, DWORD flags, LPCSTR src, INT srclen,
const union cptable *table;
int ret;
if (!src || (!dst && dstlen))
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
}
if (srclen == -1) srclen = strlen(src) + 1;
if (page >= CP_UTF7)
@ -312,6 +318,12 @@ INT WINAPI WideCharToMultiByte( UINT page, DWORD flags, LPCWSTR src, INT srclen,
const union cptable *table;
int ret, used_tmp;
if (!src || (!dst && dstlen))
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
}
if (srclen == -1) srclen = strlenW(src) + 1;
if (page >= CP_UTF7)