BUG/MEDIUM: http: the "http_first_req" sample fetch could crash without a steeam
authorWilly Tarreau <w@1wt.eu>
Wed, 29 Apr 2020 09:52:13 +0000 (11:52 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 May 2020 10:21:24 +0000 (12:21 +0200)
commit196d64c9ee05ba2f4c0fbc3526a18b0ea8cd5a44
treeed6b64f7dd91b89147a9c55dcb6c4e5899670b21
parent9bec56b7734ea75c6f235bc3f6bf03569b9bf2c5
BUG/MEDIUM: http: the "http_first_req" sample fetch could crash without a steeam

Since commit 5f940703b3 ("MINOR: log: Don't depends on a stream to process
samples in log-format string") it has become quite obvious that a few sample
fetch functions and converters were still heavily dependent on the presence
of a stream without testing for it.

The http_first_req sample fetch function, if called without a stream, will
result in a crash.

This fix adds a check for the stream's existence, and should be backported
to all stable versions up to 1.6.

(cherry picked from commit 79512b6d8f2f049a86b2332d4f4dc972cc33d631)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/http_fetch.c