]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: jwt: fix variable initialisation
authorWilliam Lallemand <wlallemand@haproxy.com>
Mon, 8 Jul 2024 12:23:14 +0000 (14:23 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 8 Jul 2024 12:23:14 +0000 (14:23 +0200)
Set the alg variable from sample_conv_jwt_verify_check() to
JWT_ALG_DEFAULT.

This was reported by coverity in #2630, but since you need to use the
first argument to use the 2nd, this has no real impact.

Mut be backported with 883f1bd (as far as 2.6).

src/sample.c

index 1756c0e4b0f36f520a47a8f1fc31e1620ec9cd4e..61d51fa36dc59eaaa916ae3ecb93a8fbd0bdf156 100644 (file)
@@ -4262,7 +4262,8 @@ static int sample_conv_json_query(const struct arg *args, struct sample *smp, vo
 static int sample_conv_jwt_verify_check(struct arg *args, struct sample_conv *conv,
                                        const char *file, int line, char **err)
 {
-       enum jwt_alg alg;
+       enum jwt_alg alg = JWT_ALG_DEFAULT;
+
        vars_check_arg(&args[0], NULL);
        vars_check_arg(&args[1], NULL);