]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: ssl: Don't do anything in ssl_subscribe if we have no ctx.
authorOlivier Houchard <ohouchard@haproxy.com>
Mon, 24 Jun 2019 16:57:39 +0000 (18:57 +0200)
committerOlivier Houchard <cognet@ci0.org>
Mon, 24 Jun 2019 17:00:16 +0000 (19:00 +0200)
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.

src/ssl_sock.c

index 1d0e4dbb1d4baeddc73019c1d1e39bbd172fb8b6..05240063bfe0bf7b2246288279b1e6fe61770463 100644 (file)
@@ -5553,6 +5553,9 @@ static int ssl_subscribe(struct connection *conn, void *xprt_ctx, int event_type
        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));