From f9ba750fd921f6696483c23c8b3cadb072f9e86f Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 3 Apr 2026 08:58:49 +0200 Subject: [PATCH] BUG/MINOR: cfgcond: always set the error string on awslc_api checks Using awslc_api_before() with an invalid argument results in "(null)" appearing in the error message due to -1 being returned without the error message being filled. Let's always fill the error message on error. This was introduced in 3.3 with commit 3d15c07ed0 ("MINOR: cfgcond: add "awslc_api_atleast" and "awslc_api_before""), and this fix must be backported to 3.3. --- src/cfgcond.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cfgcond.c b/src/cfgcond.c index 9eebada3a..345eafe71 100644 --- a/src/cfgcond.c +++ b/src/cfgcond.c @@ -294,8 +294,10 @@ int cfg_eval_cond_term(const struct cfg_cond_term *term, char **err) case CFG_PRED_AWSLC_API_ATLEAST: { // checks if the current AWSLC API is at least this one int awslcret = awslc_compare_current_api(term->args[0].data.str.area); - if (awslcret < -1) /* can't parse the string or no AWS-LC available */ + if (awslcret < -1) { /* can't parse the string or no AWS-LC available */ + memprintf(err, "invalid argument to conditional expression predicate '%s': '%s'", term->pred->word, term->args[0].data.str.area); ret = -1; + } else ret = awslcret <= 0; break; @@ -303,8 +305,10 @@ int cfg_eval_cond_term(const struct cfg_cond_term *term, char **err) case CFG_PRED_AWSLC_API_BEFORE: { // checks if the current AWSLC API is older than this one int awslcret = awslc_compare_current_api(term->args[0].data.str.area); - if (awslcret < -1) /* can't parse the string or no AWS-LC available */ + if (awslcret < -1) { /* can't parse the string or no AWS-LC available */ + memprintf(err, "invalid argument to conditional expression predicate '%s': '%s'", term->pred->word, term->args[0].data.str.area); ret = -1; + } else ret = awslcret > 0; break;