]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: jwt: Missing "case" in switch statement
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Fri, 28 Nov 2025 13:50:36 +0000 (14:50 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 28 Nov 2025 15:36:46 +0000 (16:36 +0100)
Because of missing "case" keyword in front of the values in a switch
case statement, the values were interpreted as goto tags and the switch
statement became useless.

This patch should fix GitHub issue #3200.
The fix should be backported up to 2.8.

src/sample.c

index 6c658176dfc92f1e81d7b467f03ee69ca29c9f16..0473dc86cb259df5c23cc8d838e4b30ee22fe11b 100644 (file)
@@ -4519,9 +4519,9 @@ static int sample_conv_jwt_verify_check(struct arg *args, struct sample_conv *co
 
        if (args[1].type == ARGT_STR) {
                switch (alg) {
-                       JWS_ALG_HS256:
-                       JWS_ALG_HS384:
-                       JWS_ALG_HS512:
+                       case JWS_ALG_HS256:
+                       case JWS_ALG_HS384:
+                       case JWS_ALG_HS512:
                        /* don't try to load a file with HMAC algorithms */
                                retval = 1;
                                break;