Since
368d01361 (" 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 unless
368d01361 is.
* as some of the fields may be accessed soon
*/
MT_LIST_FOR_EACH_ENTRY_LOCKED(newsrv, &servers_list, global_list, back) {
- if (srv_init(newsrv) & ERR_CODE) {
- cfgerr++;
- continue;
- }
+ err_code |= srv_init(newsrv);
+ if (err_code & ERR_CODE)
+ goto out;
}
/* starting to initialize the main proxies list */