Commit d9b8f9be authored by Wolfgang Schwotzer's avatar Wolfgang Schwotzer Committed by Alexandre Julliard

Added NULL pointer checks.

parent 5b6879c5
...@@ -246,6 +246,12 @@ INT WINAPI MultiByteToWideChar( UINT page, DWORD flags, LPCSTR src, INT srclen, ...@@ -246,6 +246,12 @@ INT WINAPI MultiByteToWideChar( UINT page, DWORD flags, LPCSTR src, INT srclen,
const union cptable *table; const union cptable *table;
int ret; int ret;
if (!src || (!dst && dstlen))
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
}
if (srclen == -1) srclen = strlen(src) + 1; if (srclen == -1) srclen = strlen(src) + 1;
if (page >= CP_UTF7) if (page >= CP_UTF7)
...@@ -312,6 +318,12 @@ INT WINAPI WideCharToMultiByte( UINT page, DWORD flags, LPCWSTR src, INT srclen, ...@@ -312,6 +318,12 @@ INT WINAPI WideCharToMultiByte( UINT page, DWORD flags, LPCWSTR src, INT srclen,
const union cptable *table; const union cptable *table;
int ret, used_tmp; int ret, used_tmp;
if (!src || (!dst && dstlen))
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
}
if (srclen == -1) srclen = strlenW(src) + 1; if (srclen == -1) srclen = strlenW(src) + 1;
if (page >= CP_UTF7) if (page >= CP_UTF7)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment