Added NULL pointer checks.
This commit is contained in:
parent
5b6879c5c0
commit
d9b8f9be37
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue