]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: vars: make sure the scope is always valid when accessing vars
authorWilly Tarreau <w@1wt.eu>
Tue, 4 Jun 2019 14:27:36 +0000 (16:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 4 Jun 2019 14:27:36 +0000 (16:27 +0200)
commitf37b140b06b9963dea8adaf5e13b5b57cd219c74
tree8c44be1b9b08ce8be2feb5895e4ec8de987cd912
parent42a6621d3057e03653233076c5d06c079dee5c22
BUG/MEDIUM: vars: make sure the scope is always valid when accessing vars

Patrick Hemmer reported that a simple tcp rule involving a variable like
this is enough to crash haproxy :

    frontend foo
        bind :8001
        tcp-request session set-var(txn.foo) src

The tests on the variables scopes is not strict enough, it needs to always
verify if the stream is valid when accessing a req/res/txn variable. This
patch does this by adding a new get_vars() function which does the job
instead of open-coding all the lookups everywhere.

It must be backported to all versions supporting set-var and
"tcp-request session" so at least 1.9 and 1.8.
src/vars.c