mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-29 02:00:37 -04:00
BUG/MEDIUM: http: the "unique-id" 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 unique-id 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.7.
This commit is contained in:
parent
79512b6d8f
commit
a1062a4de8
1 changed files with 3 additions and 0 deletions
|
|
@ -414,6 +414,9 @@ static int smp_fetch_uniqueid(const struct arg *args, struct sample *smp, const
|
|||
if (LIST_ISEMPTY(&smp->sess->fe->format_unique_id))
|
||||
return 0;
|
||||
|
||||
if (!smp->strm)
|
||||
return 0;
|
||||
|
||||
unique_id = stream_generate_unique_id(smp->strm, &smp->sess->fe->format_unique_id);
|
||||
if (!isttest(unique_id))
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue