In ssl_sock_to_buf(), before exiting, the SSL context was systematically
dereferenced to clear SSL_SOCK_F_KTLS_RX_CTRL flag. However, at the
beginning, the SSL context is tested. So theorically, it seems possible to
enter with a NULL SSL context. So to avoid any NULL dereference, the SSL
context is now tested before clearing SSL_SOCK_F_KTLS_RX_CTRL flag
This patch should solve the issue #3465. It should be backported as far as
3.3.
}
}
leave:
- ctx->flags &= ~SSL_SOCK_F_KTLS_RX_CTRL;
+ if (ctx)
+ ctx->flags &= ~SSL_SOCK_F_KTLS_RX_CTRL;
TRACE_LEAVE(SSL_EV_CONN_RECV, conn);
return done;