]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: config: fix a crash on startup when a disabled backend references a peer
authorWilly Tarreau <w@1wt.eu>
Mon, 24 Feb 2014 19:59:47 +0000 (20:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 24 Feb 2014 19:59:47 +0000 (20:59 +0100)
Disabled backends don't have their symbols resolved. We must not initialize
their peers section since they're not valid and instead still contain the
section's name.

There are other places where such unions are still in use, and other similar
errors might still happen. Ideally we should get rid of all of them in the
quite sensible config stage.

src/cfgparse.c

index 88e86d84d97043bf05e369a2e7b205224c78e3dc..f13b9679d102c6beeac350424d2de190ee9b5ffb 100644 (file)
@@ -7815,6 +7815,9 @@ out_uri_auth_compat:
         * other proxies.
         */
        for (curproxy = proxy; curproxy; curproxy = curproxy->next) {
+               if (curproxy->state == PR_STSTOPPED)
+                       continue;
+
                if (!stktable_init(&curproxy->table)) {
                        Alert("Proxy '%s': failed to initialize stick-table.\n", curproxy->id);
                        cfgerr++;