mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-09 16:47:18 +02:00
BUG/MINOR: spoe: Initialize variables used during conf parsing before any check
Some initializations must be done at the beginning of parse_spoe_flt to avoid segmentaion fault when first errors are catched, when the "filter spoe" line is parsed. This patch must be backported in 1.8. [cf: the variable "curvars" doesn't exist in 1.8. So the patch must be adapted.]
This commit is contained in:
parent
5bd37fa625
commit
84c844eb12
@ -3797,6 +3797,12 @@ parse_spoe_flt(char **args, int *cur_arg, struct proxy *px,
|
|||||||
char *file = NULL, *engine = NULL;
|
char *file = NULL, *engine = NULL;
|
||||||
int ret, pos = *cur_arg + 1;
|
int ret, pos = *cur_arg + 1;
|
||||||
|
|
||||||
|
LIST_INIT(&curmsgs);
|
||||||
|
LIST_INIT(&curgrps);
|
||||||
|
LIST_INIT(&curmphs);
|
||||||
|
LIST_INIT(&curgphs);
|
||||||
|
LIST_INIT(&curvars);
|
||||||
|
|
||||||
conf = calloc(1, sizeof(*conf));
|
conf = calloc(1, sizeof(*conf));
|
||||||
if (conf == NULL) {
|
if (conf == NULL) {
|
||||||
memprintf(err, "%s: out of memory", args[*cur_arg]);
|
memprintf(err, "%s: out of memory", args[*cur_arg]);
|
||||||
@ -3845,11 +3851,6 @@ parse_spoe_flt(char **args, int *cur_arg, struct proxy *px,
|
|||||||
curproxy = px;
|
curproxy = px;
|
||||||
curagent = NULL;
|
curagent = NULL;
|
||||||
curmsg = NULL;
|
curmsg = NULL;
|
||||||
LIST_INIT(&curmsgs);
|
|
||||||
LIST_INIT(&curgrps);
|
|
||||||
LIST_INIT(&curmphs);
|
|
||||||
LIST_INIT(&curgphs);
|
|
||||||
LIST_INIT(&curvars);
|
|
||||||
ret = readcfgfile(file);
|
ret = readcfgfile(file);
|
||||||
curproxy = NULL;
|
curproxy = NULL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user