BUG/MEDIUM: capture: capture-req/capture-res converters crash without a stream
authorWilly Tarreau <w@1wt.eu>
Wed, 29 Apr 2020 09:22:08 +0000 (11:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 May 2020 10:21:07 +0000 (12:21 +0200)
commit909523621f634a8d8a1e70a3a5024238dc313b0d
treec663230d06b82fb34a7c547981a998f919e8fea4
parentcc4f88bdb643d9b6f94a6820fec77f6aba6e7ae1
BUG/MEDIUM: capture: capture-req/capture-res converters crash without a stream

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 capture-req and capture-res converters were in this case and could
crash the process if misused.

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 5575896ba1120f136e680fd669afb5b084faa530)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/http_conv.c