BUG/MAJOR: ssl: segfault upon an heartbeat request

7b5fd1e ("MEDIUM: connections: Move some fields from struct connection
to ssl_sock_ctx.") introduced a bug in the heartbleed mitigation code.

Indeed the code used conn->ctx instead of conn->xprt_ctx for the ssl
context, resulting in a null dereference.
This commit is contained in:
William Lallemand 2019-05-13 14:31:34 +02:00 committed by William Lallemand
parent a6cc7e872a
commit 7e1770b151
1 changed files with 1 additions and 1 deletions

View File

@ -1735,7 +1735,7 @@ void ssl_sock_msgcbk(int write_p, int version, int content_type, const void *buf
for a received record) */
if ((content_type == TLS1_RT_HEARTBEAT) && (write_p == 0)) {
struct connection *conn = SSL_get_ex_data(ssl, ssl_app_data_index);
struct ssl_sock_ctx *ctx = conn->ctx;
struct ssl_sock_ctx *ctx = conn->xprt_ctx;
const unsigned char *p = buf;
unsigned int payload;