Author: hbelusca Date: Mon Mar 6 19:17:53 2017 New Revision: 74119
URL: http://svn.reactos.org/svn/reactos?rev=74119&view=rev Log: [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.
Modified: trunk/reactos/dll/win32/kernel32/winnls/string/lstring.c
Modified: trunk/reactos/dll/win32/kernel32/winnls/string/lstring.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/winnls/s... ============================================================================== --- trunk/reactos/dll/win32/kernel32/winnls/string/lstring.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/winnls/string/lstring.c [iso-8859-1] Mon Mar 6 19:17:53 2017 @@ -27,7 +27,8 @@ return 1;
Result = CompareStringA(GetThreadLocale(), 0, lpString1, -1, lpString2, -1); - if (Result) Result -= 2; + if (Result) + Result -= 2;
return Result; } @@ -55,6 +56,7 @@
return Result; } +
/* * @implemented @@ -144,6 +146,9 @@ { INT Ret = 0;
+ if (lpString == NULL) + return 0; + _SEH2_TRY { Ret = strlen(lpString); @@ -292,6 +297,9 @@ { INT Ret = 0;
+ if (lpString == NULL) + return 0; + _SEH2_TRY { Ret = wcslen(lpString);