mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-21 14:17:30 -04:00
BUG/MINOR: log: Detect missing sampling ranges in config
Consider a config like:
global
log 127.0.0.1:10001 sample :10 local0
No sampling ranges are given here, leading to NULL being passed
as the first argument to qsort.
This configuration does not make sense anyway, a log without ranges
would never log. Thus output an error if no ranges are given.
This bug was introduced in d95ea2897e.
This fix must be backported to HAProxy 2.0.
This commit is contained in:
parent
2f6d3c0d65
commit
2164800c1b
1 changed files with 5 additions and 0 deletions
|
|
@ -929,6 +929,11 @@ int parse_logsrv(char **args, struct list *logsrvs, int do_del, char **err)
|
|||
smp_rgs_sz++;
|
||||
}
|
||||
|
||||
if (smp_rgs == NULL) {
|
||||
memprintf(err, "no sampling ranges given");
|
||||
goto error;
|
||||
}
|
||||
|
||||
beg = smp_sz_str;
|
||||
end = beg + strlen(beg);
|
||||
new_smp_sz = read_uint((const char **)&beg, end);
|
||||
|
|
|
|||
Loading…
Reference in a new issue