mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-05 19:52:14 +00:00
BUG/MINOR: http-fetch: Make method smp safe if headers were already forwarded
When method sample fetch is called, if an exotic method is found (HTTP_METH_OTHER), when smp_prefetch_htx() is called, we must be sure the start-line is still there. Otherwise, HAproxy may crash because of a NULL pointer dereference, for instance if the method sample fetch is used inside a unique-id format string. Indeed, the unique id may be generated when the log message is emitted. At this stage, the request channel is empty. This patch must be backported as far as 2.0. But the bug exists in all stable versions for the legacy HTTP mode too. Thus it must be adapted to the legacy HTTP mode and backported to all other stable versions.
This commit is contained in:
parent
4bef8d1d46
commit
6f97a611c8
@ -342,7 +342,7 @@ static int smp_fetch_meth(const struct arg *args, struct sample *smp, const char
|
||||
return 0;
|
||||
}
|
||||
|
||||
htx = smp_prefetch_htx(smp, chn, NULL, 0);
|
||||
htx = smp_prefetch_htx(smp, chn, NULL, 1);
|
||||
if (!htx)
|
||||
return 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user