mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-14 15:34:35 +00:00
BUG/MINOR: cfgparse: Check if tune.http.maxhdr is in the range 1..32767
We cannot store more than 32K headers in the structure hdr_idx, because internaly we use signed short integers. To avoid any bugs (due to an integers overflow), a check has been added on tune.http.maxhdr to be sure to not set a value greater than 32767 and lower than 1 (because this is a nonsense to set this parameter to a value <= 0). The documentation has been updated accordingly. This patch can be backported in 1.7, 1.6 and 1.5.
This commit is contained in:
parent
5d6e5f86c5
commit
50174f3600
@ -1374,9 +1374,9 @@ tune.http.maxhdr <number>
|
||||
are blocked with "502 Bad Gateway". The default value is 101, which is enough
|
||||
for all usages, considering that the widely deployed Apache server uses the
|
||||
same limit. It can be useful to push this limit further to temporarily allow
|
||||
a buggy application to work by the time it gets fixed. Keep in mind that each
|
||||
new header consumes 32bits of memory for each session, so don't push this
|
||||
limit too high.
|
||||
a buggy application to work by the time it gets fixed. The accepted range is
|
||||
1..32767. Keep in mind that each new header consumes 32bits of memory for
|
||||
each session, so don't push this limit too high.
|
||||
|
||||
tune.idletimer <timeout>
|
||||
Sets the duration after which haproxy will consider that an empty buffer is
|
||||
|
@ -916,7 +916,13 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
|
||||
err_code |= ERR_ALERT | ERR_FATAL;
|
||||
goto out;
|
||||
}
|
||||
global.tune.max_http_hdr = atol(args[1]);
|
||||
global.tune.max_http_hdr = atoi(args[1]);
|
||||
if (global.tune.max_http_hdr < 1 || global.tune.max_http_hdr > 32767) {
|
||||
Alert("parsing [%s:%d] : '%s' expects a numeric value between 1 and 32767\n",
|
||||
file, linenum, args[0]);
|
||||
err_code |= ERR_ALERT | ERR_FATAL;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
else if (!strcmp(args[0], "tune.comp.maxlevel")) {
|
||||
if (alertif_too_many_args(1, file, linenum, args, &err_code))
|
||||
|
Loading…
Reference in New Issue
Block a user