As reported by Bryan Talbot, enabling and disabling a server in a disabled
proxy causes a segfault.

Changing the weight can also cause a similar segfault.
---
 src/dumpstats.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/dumpstats.c b/src/dumpstats.c
index 3ac038c..1e30abb 100644
--- a/src/dumpstats.c
+++ b/src/dumpstats.c
@@ -480,6 +480,12 @@ int stats_sock_parse_request(struct stream_interface *si, 
char *line)
                                return 1;
                        }
 
+                       if (px->state == PR_STSTOPPED) {
+                               s->data_ctx.cli.msg = "Proxy is disabled.\n";
+                               si->st0 = STAT_CLI_PRINT;
+                               return 1;
+                       }
+
                        /* if the weight is terminated with '%', it is set 
relative to
                         * the initial weight, otherwise it is absolute.
                         */
@@ -590,6 +596,12 @@ int stats_sock_parse_request(struct stream_interface *si, 
char *line)
                                return 1;
                        }
 
+                       if (px->state == PR_STSTOPPED) {
+                               s->data_ctx.cli.msg = "Proxy is disabled.\n";
+                               si->st0 = STAT_CLI_PRINT;
+                               return 1;
+                       }
+
                        if (sv->state & SRV_MAINTAIN) {
                                /* The server is really in maintenance, we can 
change the server state */
                                if (sv->tracked) {
@@ -645,6 +657,12 @@ int stats_sock_parse_request(struct stream_interface *si, 
char *line)
                                return 1;
                        }
 
+                       if (px->state == PR_STSTOPPED) {
+                               s->data_ctx.cli.msg = "Proxy is disabled.\n";
+                               si->st0 = STAT_CLI_PRINT;
+                               return 1;
+                       }
+
                        if (! (sv->state & SRV_MAINTAIN)) {
                                /* Not already in maintenance, we can change 
the server state */
                                sv->state |= SRV_MAINTAIN;
-- 
1.7.4.1


Reply via email to