lstrlen(A/W) patch

Clinton Stimpson clinton at elemtech.com
Mon Jun 5 22:24:24 CDT 2006


I encountered a crash when using PAF 5.2.

The following patch will fix the crash.
MSDN documentation says "*lstrlen* assumes that /lpString/ is a 
null-terminated string, or NULL"

Patch below:

Thanks,
Clinton Stimpson



Index: winbase.h
===================================================================
RCS file: /home/wine/wine/include/winbase.h,v
retrieving revision 1.258
diff -u -r1.258 winbase.h
--- winbase.h   27 May 2006 11:37:00 -0000      1.258
+++ winbase.h   6 Jun 2006 03:23:03 -0000
@@ -2100,6 +2100,7 @@

 extern inline INT WINAPI lstrlenW( LPCWSTR str )
 {
+    if(!str) return 0;
     const WCHAR *s = str;
     while (*s) s++;
     return s - str;
@@ -2107,6 +2108,7 @@

 extern inline INT WINAPI lstrlenA( LPCSTR str )
 {
+    if(!str) return 0;
     return strlen( str );
 }





More information about the wine-patches mailing list