]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: cfgparse: immediately stop after hard error in srv_init()
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 30 Jul 2025 13:10:27 +0000 (15:10 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 7 Aug 2025 20:26:37 +0000 (22:26 +0200)
commit525750e1356a21f55cc3bb50e802b0a13b58daa5
tree28638ca44aa59a4fc663c5e5a45a7d718c97c63b
parent731b52ded958fd814ec21d3f19053fab0eaee86e
BUG/MINOR: cfgparse: immediately stop after hard error in srv_init()

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.
src/cfgparse.c