BUG/MEDIUM: ssl: Don't do anything in ssl_subscribe if we have no ctx.
In ssl_subscribe(), make sure we have a ssl_sock_ctx before doing anything.
When ssl_sock_close() is called, it wakes any subscriber up, and that
subscriber may decide to subscribe again, for some reason. If we no longer
have a context, there's not much we can do.
This should be backported to 2.0.
(cherry picked from commit 0ff28651c184f2b6cc7782b0960ed69cc907ca97)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 1d0e4db..0524006 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -5553,6 +5553,9 @@
struct wait_event *sw;
struct ssl_sock_ctx *ctx = xprt_ctx;
+ if (!ctx)
+ return -1;
+
if (event_type & SUB_RETRY_RECV) {
sw = param;
BUG_ON(ctx->recv_wait != NULL || (sw->events & SUB_RETRY_RECV));