From: Christopher Faulet Date: Wed, 6 Jul 2022 15:53:02 +0000 (+0200) Subject: BUG/MEDIUM: http-fetch: Don't fetch the method if there is no stream X-Git-Tag: v2.7-dev2~85 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=12f6dbb863fe941c6d84cf3d521dfcb4c0e2f355;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/http_fetch.c b/src/http_fetch.c index 1c331e0aed..f70fc7f033 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;