From: Christopher Faulet Date: Tue, 19 Sep 2017 08:35:35 +0000 (+0200) Subject: BUG/MINOR: spoe: Don't compare engine name and SPOE scope when both are NULL X-Git-Tag: v1.8-rc1~196 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1405e5f802123eec8270ab87d6e9637c40dfd6a;p=thirdparty%2Fhaproxy.git BUG/MINOR: spoe: Don't compare engine name and SPOE scope when both are NULL SPOE filter can be declared without engine name. This is an optional parameter. But in this case, no scope must be used in the SPOE configuration file. So engine name and scope are both undefined, and, obviously, we must not try to compare them. This patch must be backported in 1.7. --- diff --git a/src/flt_spoe.c b/src/flt_spoe.c index 228770c9a9..abaded156c 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -2967,7 +2967,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm) if ((cfg_scope == NULL && curengine != NULL) || (cfg_scope != NULL && curengine == NULL) || - strcmp(curengine, cfg_scope)) + (curengine != NULL && cfg_scope != NULL && strcmp(curengine, cfg_scope))) goto out; if (!strcmp(args[0], "spoe-agent")) { /* new spoe-agent section */ @@ -3274,7 +3274,7 @@ cfg_parse_spoe_message(const char *file, int linenum, char **args, int kwm) if ((cfg_scope == NULL && curengine != NULL) || (cfg_scope != NULL && curengine == NULL) || - strcmp(curengine, cfg_scope)) + (curengine != NULL && cfg_scope != NULL && strcmp(curengine, cfg_scope))) goto out; if (!strcmp(args[0], "spoe-message")) { /* new spoe-message section */