From: Timo Sirainen Date: Wed, 29 Apr 2009 16:40:48 +0000 (-0400) Subject: ssl-proxy: Crashfix to previous commit. X-Git-Tag: 2.0.alpha1~886 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=db3723333bd09e1b251490477d559822395a5aa0;p=thirdparty%2Fdovecot%2Fcore.git ssl-proxy: Crashfix to previous commit. --HG-- branch : HEAD --- diff --git a/src/login-common/ssl-proxy-openssl.c b/src/login-common/ssl-proxy-openssl.c index b445cf860c..98e8351ccc 100644 --- a/src/login-common/ssl-proxy-openssl.c +++ b/src/login-common/ssl-proxy-openssl.c @@ -51,7 +51,7 @@ struct ssl_proxy { unsigned int sslout_size; ssl_handshake_callback_t *handshake_callback; - void *handshake_callback_context; + void *handshake_context; char *last_error; unsigned int handshaked:1; @@ -421,8 +421,10 @@ static void ssl_handshake(struct ssl_proxy *proxy) ssl_set_io(proxy, SSL_ADD_INPUT); plain_block_input(proxy, FALSE); - if (proxy->handshake_callback(proxy->handshake_callback_context) < 0) - ssl_proxy_destroy(proxy); + if (proxy->handshake_callback != NULL) { + if (proxy->handshake_callback(proxy->handshake_context) < 0) + ssl_proxy_destroy(proxy); + } } static void ssl_read(struct ssl_proxy *proxy) @@ -567,7 +569,7 @@ int ssl_proxy_client_new(int fd, struct ip_addr *ip, return -1; (*proxy_r)->handshake_callback = callback; - (*proxy_r)->handshake_callback_context = context; + (*proxy_r)->handshake_context = context; (*proxy_r)->client = TRUE; ssl_step(*proxy_r); return ret;