]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h1: Fix a possible null pointer dereference in h1_subscribe()
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 4 Sep 2019 08:22:34 +0000 (10:22 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 4 Sep 2019 08:30:11 +0000 (10:30 +0200)
This patch fixes the github issue #243. No backport needed.

src/mux_h1.c

index 647a44f8f1ac4253511d697c21cde4a1877e6f73..e6383305b027ba967eac502dd54dc289ec4842a9 100644 (file)
@@ -2382,7 +2382,7 @@ static int h1_subscribe(struct conn_stream *cs, int event_type, void *param)
 {
        struct wait_event *sw;
        struct h1s *h1s = cs->ctx;
-       struct h1c *h1c = h1s->h1c;
+       struct h1c *h1c;
 
        if (!h1s)
                return -1;
@@ -2405,6 +2405,7 @@ static int h1_subscribe(struct conn_stream *cs, int event_type, void *param)
                         * probably means the connection wasn't established
                         * yet, so we have to subscribe.
                         */
+                       h1c = h1s->h1c;
                        if (!(h1c->wait_event.events & SUB_RETRY_SEND))
                                h1c->conn->xprt->subscribe(h1c->conn,
                                                           h1c->conn->xprt_ctx,