diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2016-03-21 19:17:29 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2016-03-21 19:17:29 +0100 |
commit | aa248ad3b080b57666b3d984a50830152baded8c (patch) | |
tree | 2fc13b1a4bd2b7b8e0f366b3cdcc5ef4a7018d26 /src/plugins | |
parent | cf6aca1619c32422a43fa3d82e0674f6b7b49fe9 (diff) | |
download | weechat-aa248ad3b080b57666b3d984a50830152baded8c.zip |
irc: fix crash in SSL connection to the server
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/irc/irc-server.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index cd18494a1..99da1d3f6 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -3980,7 +3980,8 @@ irc_server_check_certificate_fingerprint (struct t_irc_server *server, #ifdef HAVE_GNUTLS int -irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, +irc_server_gnutls_callback (const void *pointer, void *data, + gnutls_session_t tls_session, const gnutls_datum_t *req_ca, int nreq, const gnutls_pk_algorithm_t *pk_algos, int pk_algos_len, @@ -4011,6 +4012,7 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, #endif /* LIBGNUTLS_VERSION_NUMBER >= 0x010706 */ /* make C compiler happy */ + (void) data; (void) req_ca; (void) nreq; (void) pk_algos; @@ -4018,10 +4020,10 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session, rc = 0; - if (!data) + if (!pointer) return -1; - server = (struct t_irc_server *) data; + server = (struct t_irc_server *) pointer; cert_temp_init = 0; cert_list = NULL; cert_list_len = 0; @@ -4556,7 +4558,7 @@ irc_server_connect (struct t_irc_server *server) proxy_type ? weechat_config_integer (proxy_ipv6) : IRC_SERVER_OPTION_BOOLEAN(server, IRC_SERVER_OPTION_IPV6), server->current_retry, (server->ssl_connected) ? &server->gnutls_sess : NULL, - (server->ssl_connected) ? irc_server_gnutls_callback : NULL, + (server->ssl_connected) ? &irc_server_gnutls_callback : NULL, IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_SSL_DHKEY_SIZE), IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_SSL_PRIORITIES), IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_LOCAL_HOSTNAME), |