]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: compression: Fix check on txn in smp_fetch_res_comp_algo
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 15 Sep 2017 08:14:43 +0000 (10:14 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 Sep 2017 16:42:23 +0000 (18:42 +0200)
The check was totally messed up. In the worse case, it led to a crash, when
res.comp_algo sample fetch was retrieved on uncompressed response (with the
compression enabled).

This patch must be backported in 1.7.

src/flt_http_comp.c

index 64c669d54ddc5f5621f2fb07f0d913ed5c5bd0fe..4d5332832fc1afb2ae5be43460e89692e9dfcc61 100644 (file)
@@ -923,7 +923,7 @@ smp_fetch_res_comp_algo(const struct arg *args, struct sample *smp,
        struct filter     *filter;
        struct comp_state *st;
 
-       if (!(txn || !(txn->rsp.flags & HTTP_MSGF_COMPRESSING)))
+       if (!txn || !(txn->rsp.flags & HTTP_MSGF_COMPRESSING))
                return 0;
 
        list_for_each_entry(filter, &strm_flt(smp->strm)->filters, list) {