From 12f6dbb863fe941c6d84cf3d521dfcb4c0e2f355 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 6 Jul 2022 17:53:02 +0200 Subject: [PATCH] BUG/MEDIUM: http-fetch: Don't fetch the method if there is no stream The "method" sample fetch does not perform any check on the stream existence before using it. However, for errors triggered at the mux level, there is no stream. When the log message is formatted, this sample fetch must fail. It must also fail when it is called from a health-check. This patch must be backported as far as 2.4. --- src/http_fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http_fetch.c b/src/http_fetch.c index 1c331e0ae..f70fc7f03 100644 --- a/src/http_fetch.c +++ b/src/http_fetch.c @@ -337,7 +337,7 @@ static int smp_fetch_meth(const struct arg *args, struct sample *smp, const char struct htx *htx; int meth; - txn = smp->strm->txn; + txn = (smp->strm ? smp->strm->txn : NULL); if (!txn) return 0;