From 27f2dbbdfdb589bc5659cfdda2479c5fb47821fd Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 27 Jun 2017 15:47:56 +0200 Subject: [PATCH] BUG/MAJOR: frontend: don't dereference a null conn on outgoing connections 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend.c b/src/frontend.c index 248050850..8e2bf2fcd 100644 --- a/src/frontend.c +++ b/src/frontend.c @@ -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)