# HG changeset patch # User Senko Rasic # Date 1193783804 -3600 # Node ID 3299004130574989b42cc25e7544b28e9c8e447c # Parent 7e2050a6df75bfa9e5c8bf0f9832168f1d69c4d9 Check to see that the OpenSSL session is setup correctly. Fixes LM-88. If the SSL Context is not setup correctly the call to SSL_new will fail as well causing SSL_set_bio to segfault. Added a check to see that the context is not NULL and that the session is created properly. Fix for LM1.2 by Mikael Hallendal, forward-ported to LM1.3 by Senko Rasic. diff -r 7e2050a6df75 -r 329900413057 loudmouth/lm-ssl-openssl.c --- a/loudmouth/lm-ssl-openssl.c Tue Oct 30 23:27:30 2007 +0100 +++ b/loudmouth/lm-ssl-openssl.c Tue Oct 30 23:36:44 2007 +0100 @@ -321,6 +321,13 @@ gint ssl_ret; GIOStatus status; + if (!ssl->ssl_ctx) { + g_set_error (error, + LM_ERROR, LM_ERROR_CONNECTION_OPEN, + "No SSL Context for OpenSSL"); + return FALSE; + } + ssl->ssl = SSL_new(ssl->ssl_ctx); if (ssl->ssl == NULL) { g_warning ("SSL_new() == NULL");