mirror of
https://github.com/reactos/reactos.git
synced 2025-07-24 22:23:49 +00:00
[KERNEL32]: Check for NULL pointer specified to lstrlenA/W and return null length, as specified in the MSDN doc and checked by the tests of r74118.
This should remove the unwanted 1st-chance exceptions caught when debugging Office 2010 installation, that calls from time to time lstrlen with NULL pointers. svn path=/trunk/; revision=74119
This commit is contained in:
parent
c5dde308bf
commit
f606ee89dd
1 changed files with 9 additions and 1 deletions
|
@ -27,7 +27,8 @@ lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
|
|||
return 1;
|
||||
|
||||
Result = CompareStringA(GetThreadLocale(), 0, lpString1, -1, lpString2, -1);
|
||||
if (Result) Result -= 2;
|
||||
if (Result)
|
||||
Result -= 2;
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
@ -56,6 +57,7 @@ lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
|
|||
return Result;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
@ -144,6 +146,9 @@ lstrlenA(LPCSTR lpString)
|
|||
{
|
||||
INT Ret = 0;
|
||||
|
||||
if (lpString == NULL)
|
||||
return 0;
|
||||
|
||||
_SEH2_TRY
|
||||
{
|
||||
Ret = strlen(lpString);
|
||||
|
@ -292,6 +297,9 @@ lstrlenW(LPCWSTR lpString)
|
|||
{
|
||||
INT Ret = 0;
|
||||
|
||||
if (lpString == NULL)
|
||||
return 0;
|
||||
|
||||
_SEH2_TRY
|
||||
{
|
||||
Ret = wcslen(lpString);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue