From: Christopher Faulet Date: Mon, 27 Jan 2020 14:51:56 +0000 (+0100) Subject: BUG/MINOR: http-rules: Always init log-format expr for common HTTP actions X-Git-Tag: v2.2-dev2~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c20b37112b74f20431ba8e24a13b6260d7ba0e1d;p=thirdparty%2Fhaproxy.git BUG/MINOR: http-rules: Always init log-format expr for common HTTP actions Many HTTP actions rely on <.arg.http> in the act_rule structure. Not all actions use the log-format expression, but it must be initialized anyway. Otherwise, HAProxy may crash during the deinit when the release function is called. No backport needed. This patch should fix issue #468. --- diff --git a/src/http_act.c b/src/http_act.c index a7f9e119dc..163213099e 100644 --- a/src/http_act.c +++ b/src/http_act.c @@ -335,6 +335,7 @@ static enum act_parse_ret parse_http_set_status(const char **args, int *orig_arg (*orig_arg)++; } + LIST_INIT(&rule->arg.http.fmt); return ACT_RET_PRS_OK; } @@ -928,6 +929,7 @@ static enum act_parse_ret parse_http_auth(const char **args, int *orig_arg, stru cur_arg++; } + LIST_INIT(&rule->arg.http.fmt); *orig_arg = cur_arg; return ACT_RET_PRS_OK; } @@ -953,6 +955,7 @@ static enum act_parse_ret parse_http_set_nice(const char **args, int *orig_arg, else if (rule->arg.http.i > 1024) rule->arg.http.i = 1024; + LIST_INIT(&rule->arg.http.fmt); *orig_arg = cur_arg + 1; return ACT_RET_PRS_OK; } @@ -980,6 +983,7 @@ static enum act_parse_ret parse_http_set_tos(const char **args, int *orig_arg, s return ACT_RET_PRS_ERR; } + LIST_INIT(&rule->arg.http.fmt); *orig_arg = cur_arg + 1; return ACT_RET_PRS_OK; #else @@ -1011,6 +1015,7 @@ static enum act_parse_ret parse_http_set_mark(const char **args, int *orig_arg, return ACT_RET_PRS_ERR; } + LIST_INIT(&rule->arg.http.fmt); *orig_arg = cur_arg + 1; global.last_checks |= LSTCHK_NETADM; return ACT_RET_PRS_OK; @@ -1041,6 +1046,7 @@ static enum act_parse_ret parse_http_set_log_level(const char **args, int *orig_ else if ((rule->arg.http.i = get_log_level(args[cur_arg]) + 1) == 0) goto bad_log_level; + LIST_INIT(&rule->arg.http.fmt); *orig_arg = cur_arg + 1; return ACT_RET_PRS_OK; } @@ -1372,6 +1378,7 @@ static enum act_parse_ret parse_http_del_header(const char **args, int *orig_arg px->conf.args.ctx = (rule->from == ACT_F_HTTP_REQ ? ARGC_HRQ : ARGC_HRS); + LIST_INIT(&rule->arg.http.fmt); *orig_arg = cur_arg + 1; return ACT_RET_PRS_OK; }