]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MAJOR: frontend: don't dereference a null conn on outgoing connections
authorWilly Tarreau <w@1wt.eu>
Tue, 27 Jun 2017 13:47:56 +0000 (15:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 27 Jun 2017 13:47:56 +0000 (15:47 +0200)
Recently merged commit 0cfe388 ("MINOR: frontend: retrieve the ALPN name when
available") assumed that the connection is always known in frontend_accept()
which is not true for outgoing peers connections for example.

No backport needed.

src/frontend.c

index 24805085037152cb6e9db0fa1137d7b428796dc8..8e2bf2fcdf5bffffb655a553b871b96d9d19a083 100644 (file)
@@ -62,7 +62,7 @@ int frontend_accept(struct stream *s)
        /* check if we're in HTTP mode, directly connected to the connection,
         * and with ALPN advertising H2.
         */
-       if (conn->owner == &s->si[0])
+       if (conn && conn->owner == &s->si[0])
                conn_get_alpn(conn, &alpn_str, &alpn_len);
 
        if ((fe->mode == PR_MODE_TCP || fe->mode == PR_MODE_HTTP)