secur32: check for variable before freeing it

Vitaliy Margolen wine-devel at kievinfo.com
Tue Oct 13 08:30:23 CDT 2009


Henri Verbeet wrote:
> 2009/10/13 Austin English <austinenglish at gmail.com>:
>>              cred = schan_free_handle(i, SCHAN_HANDLE_CRED);
>> -            pgnutls_certificate_free_credentials(cred->credentials);
>> +            if(cred) pgnutls_certificate_free_credentials(cred->credentials);
> I don't think "cred" is ever supposed to be NULL. Could you add some
> traces to see where that handle comes from?
> 
> 
This is the place Steam silently crashes on exit (found it last night with
valgrind):

==21864== Thread 1:
==21864== Invalid read of size 4
==21864==    at 0x153668B5: SECUR32_deinitSchannelSP (schannel.c:1438)
==21864==    by 0x1536BBFA: DllMain (secur32.c:675)
==21864==    by 0x1536FF6D: __wine_spec_dll_entry (dll_entry.c:40)
==21864==    by 0x7BC47674: ??? (in
/usr/local/src/wine.git-build/dlls/ntdll/ntdll.dll.so)
==21864==    by 0x7BC49672: MODULE_InitDLL (loader.c:985)
==21864==    by 0x7BC4A1CA: process_detach (loader.c:1156)
==21864==    by 0x7BC4ACDC: LdrUnloadDll (loader.c:2387)
==21864==    by 0x7B865A74: FreeLibrary (module.c:1023)
==21864==    by 0x30011254: ??? (in
/home/vitaliy/.wine-steam/drive_c/Program Files/Steam/Steam.dll)
==21864==    by 0x30004EC8: ??? (in
/home/vitaliy/.wine-steam/drive_c/Program Files/Steam/Steam.dll)
==21864==    by 0x301121F0: ??? (in
/home/vitaliy/.wine-steam/drive_c/Program Files/Steam/Steam.dll)
==21864==    by 0x4119F4: ??? (in /home/vitaliy/.wine-steam/drive_c/Program
Files/Steam/steam.exe)
==21864==  Address 0x4 is not stack'd, malloc'd or (recently) free'd


Vitaliy.



More information about the wine-devel mailing list