From: Willy Tarreau Date: Mon, 11 May 2026 12:44:12 +0000 (+0200) Subject: BUG/MINOR: mux-h1: only check h1s if not NULL X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=009c32d863d74d10a209a43242e0279278a3957c;p=haproxy.git BUG/MINOR: mux-h1: only check h1s if not NULL Since we can emit glitches during an H2 upgrade, we no longer have a guaranteed h1s, so _h1_report_glitch() must check h1s before dereferencing it. No backport is needed as this arrived in 3.4-dev11 with commit 72fd357814 ("MEDIUM: mux-h1: Return an error on h2 upgrade attempts if not allowed"). --- diff --git a/src/mux_h1.c b/src/mux_h1.c index b5c0fd3a5..f8eaaccfb 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -536,7 +536,8 @@ static inline int _h1_report_glitch(struct h1c *h1c, int increment) /* at 75% of the threshold, we switch to close mode * to force clients to periodically reconnect. */ - h1c->h1s->flags = (h1c->h1s->flags & ~H1S_F_WANT_MSK) | H1S_F_WANT_CLO; + if (h1c->h1s) + h1c->h1s->flags = (h1c->h1s->flags & ~H1S_F_WANT_MSK) | H1S_F_WANT_CLO; /* at 100% of the threshold and excess of CPU usage we also * actively kill the connection.