mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-20 20:50:44 +00:00
BUG/MINOR: config: check that tune.bufsize is always positive
We must not accept negative values for tune.bufsize as they will only result in crashing the process during the parsing.
This commit is contained in:
parent
a30b5dbf85
commit
9b69454570
@ -828,6 +828,11 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
|
||||
goto out;
|
||||
}
|
||||
global.tune.bufsize = atol(args[1]);
|
||||
if (global.tune.bufsize <= 0) {
|
||||
Alert("parsing [%s:%d] : '%s' expects a positive integer argument.\n", file, linenum, args[0]);
|
||||
err_code |= ERR_ALERT | ERR_FATAL;
|
||||
goto out;
|
||||
}
|
||||
if (global.tune.maxrewrite >= global.tune.bufsize / 2)
|
||||
global.tune.maxrewrite = global.tune.bufsize / 2;
|
||||
chunk_init(&trash, realloc(trash.str, global.tune.bufsize), global.tune.bufsize);
|
||||
|
Loading…
Reference in New Issue
Block a user