mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-09 08:37:04 +02:00
BUG/MINOR: cfgparse: immediately stop after hard error in srv_init()
Since368d01361
(" MEDIUM: server: add and use srv_init() function"), in case of srv_init() error, we simply increment cfgerr variable and keep going. It isn't enough, some treatment occuring later in check_config_validity() assume that srv_init() succeeded for servers, and may cause undefined behavior. To fix the issue, let's consider that if (srv_init() & ERR_CODE) returns true, then we must stop checking the config immediately. No backport needed unless368d01361
is.
This commit is contained in:
parent
731b52ded9
commit
525750e135
@ -2824,10 +2824,9 @@ int check_config_validity()
|
|||||||
* as some of the fields may be accessed soon
|
* as some of the fields may be accessed soon
|
||||||
*/
|
*/
|
||||||
MT_LIST_FOR_EACH_ENTRY_LOCKED(newsrv, &servers_list, global_list, back) {
|
MT_LIST_FOR_EACH_ENTRY_LOCKED(newsrv, &servers_list, global_list, back) {
|
||||||
if (srv_init(newsrv) & ERR_CODE) {
|
err_code |= srv_init(newsrv);
|
||||||
cfgerr++;
|
if (err_code & ERR_CODE)
|
||||||
continue;
|
goto out;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* starting to initialize the main proxies list */
|
/* starting to initialize the main proxies list */
|
||||||
|
Loading…
Reference in New Issue
Block a user