]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: http-conv: Remove unreachable goto statement in sample_conv_q_preferred
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 6 Nov 2024 09:06:50 +0000 (10:06 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 6 Nov 2024 09:06:52 +0000 (10:06 +0100)
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.

src/http_conv.c

index c2a3e281eb347e345a9d9c7f47579f74367c1708..30056036c5cb1089e4028e524f4a6098031db052 100644 (file)
@@ -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++;