From: Christopher Faulet Date: Wed, 6 Nov 2024 09:06:50 +0000 (+0100) Subject: MINOR: http-conv: Remove unreachable goto statement in sample_conv_q_preferred X-Git-Tag: v3.1-dev12~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=97d3096040f5ee52d69492f675bcd06ce8aa9e3e;p=thirdparty%2Fhaproxy.git MINOR: http-conv: Remove unreachable goto statement in sample_conv_q_preferred This was reported by Coverity. In sample_conv_q_preferred() function, a goto statement after a "while(1)" loop is unreachable. Instead of just removing it, the same goto statement in the loop is replaced by a break. It is safer this way, in case the loop change in future. This patch should fix the issue #2683. --- diff --git a/src/http_conv.c b/src/http_conv.c index c2a3e281eb..30056036c5 100644 --- a/src/http_conv.c +++ b/src/http_conv.c @@ -157,7 +157,7 @@ static int sample_conv_q_preferred(const struct arg *args, struct sample *smp, v if (http_language_range_match(token, toklen, w, str - w)) goto look_for_q; if (*str == '\0') - goto expect_comma; + break; w = str + 1; } str++;