http://bugs.winehq.org/show_bug.cgi?id=22514
Timur Iskhodzhanov timurrrr@google.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |UNCONFIRMED Resolution|INVALID |
--- Comment #4 from Timur Iskhodzhanov timurrrr@google.com 2010-04-28 08:37:39 --- Ah, sorry.
However, I think the implementation in dlls/kernel32/string.c is wrong as well:
>>>>>>>>>>
INT WINAPI lstrlenA( LPCSTR str ) { INT ret; __TRY { ret = strlen(str); } __EXCEPT_PAGE_FAULT { SetLastError( ERROR_INVALID_PARAMETER ); return 0; } __ENDTRY return ret; }
/*********************************************************************** * lstrlenW (KERNEL32.@) */ INT WINAPI lstrlenW( LPCWSTR str ) { INT ret; __TRY { ret = strlenW(str); } __EXCEPT_PAGE_FAULT { SetLastError( ERROR_INVALID_PARAMETER ); return 0; } __ENDTRY return ret; } <<<<<<<<<<<<<<<<<
As you can see, it calls SetLastError if we pass NULL as a parameter. Also, it reads *(NULL) which is why Valgrind is reporting "uninitialized reads". I don't think it's a good idea to read *(NULL) if we can easily do without.