Marcus Meissner wrote:
On Mon, Dec 12, 2005 at 01:58:37AM -0600, Robert Shearman wrote:
Marcus Meissner wrote:
Hi,
Redirect from http to https currently segfaults our wininet implementation.
Exposed by the Google Earth update check.
Ciao, Marcus
Changelog: When redirecting, do not forget to reinit NETCON.
This shouldn't be necessary. The NETCONNECTION structure should have been re-initialized to its post-NETCON_init state after calling NETCON_close. There are two possible reasons I can think of that would cause a crash. The first is the NETCONNECTION stuff not being thread-safe. The second is possible ref-counting issues on the SSL method object "meth". Can you show me the backtrace?
(gdb) r GoogleEarth.exe Starting program: /usr/bin/wine-pthread GoogleEarth.exe fixme:atl:AtlModuleInit SEMI-STUB (0x466920 0x4658f8 0x400000) fixme:imm:ImmGetContext (0x10020): stub fixme:imm:ImmReleaseContext (0x10020, 0x558fa9b0): stub fixme:imm:ImmGetContext (0x10020): stub fixme:imm:ImmReleaseContext (0x10020, 0x558fa9b0): stub
Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1433261760 (LWP 17926)] 0x00000000 in ?? () (gdb) bt #0 0x00000000 in ?? () #1 0x55fe61c6 in NETCON_secure_connect (connection=0x55983b40, hostname=0x55983970) at netconnection.c:348 #2 0x55fd9bb1 in HTTP_HttpSendRequestW (lpwhr=0x55983b10, lpszHeaders=0x0, dwHeaderLength=0, lpOptional=0x0, dwOptionalLength=0, dwContentLength=0, bEndRequest=1) at http.c:2262 #3 0x55fd8375 in HTTP_HandleRedirect (lpwhr=Cannot access memory at address 0x55c0c16c ) at http.c:1890 #4 0x55fd95c2 in HTTP_HttpSendRequestW (lpwhr=0x55983b10, lpszHeaders=0x0, dwHeaderLength=0, lpOptional=0x0, dwOptionalLength=0, dwContentLength=0, bEndRequest=1) at http.c:2094 #5 0x55fda480 in HttpSendRequestW (hHttpRequest=0x3, lpszHeaders=0x0, dwHeaderLength=0, lpOptional=0x0, dwOptionalLength=0) at http.c:1703 #6 0x56ffb887 in ?? () (gdb) up #1 0x55fe61c6 in NETCON_secure_connect (connection=0x55983b40, hostname=0x55983970) at netconnection.c:348 348 ctx = pSSL_CTX_new(meth); (gdb) print meth $1 = (SSL_METHOD *) 0x0 (gdb) print pSSL_CTX_new $2 = (SSL_CTX *(*)()) 0 (gdb) print *connection $3 = {useSSL = 0, socketFD = 38, ssl_s = 0x0, peek_msg = 0x0, peek_msg_mem = 0x0}
NETCON_init() just never got called with useSSL before.
In that case, your patch looks correct.