]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ot: fixed wrong NULL check in flt_ot_parse_cfg_group()
authorMiroslav Zagorac <mzagorac@haproxy.com>
Wed, 18 Jan 2023 18:33:21 +0000 (19:33 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 13 Apr 2026 07:23:30 +0000 (09:23 +0200)
After calling flt_ot_conf_group_init() and storing the result in
flt_ot_current_group, the code incorrectly checked flt_ot_current_config
for NULL instead of the newly assigned flt_ot_current_group.  This meant
a failed group init was never detected and the error path was never taken.

addons/ot/src/parser.c

index e067501cd5dd15ef93925e6b331eda9c02a70722..c59a18418769b72c6c320c53ec4be3500742f13c 100644 (file)
@@ -640,7 +640,7 @@ static int flt_ot_parse_cfg_group(const char *file, int linenum, char **args, in
 
        if (pdata->keyword == FLT_OT_PARSE_GROUP_ID) {
                flt_ot_current_group = flt_ot_conf_group_init(args[1], linenum, &(flt_ot_current_config->groups), &err);
-               if (flt_ot_current_config == NULL)
+               if (flt_ot_current_group == NULL)
                        retval |= ERR_ABORT | ERR_ALERT;
        }
        else if (pdata->keyword == FLT_OT_PARSE_GROUP_SCOPES) {