]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: jwt: Missing 'jwt_tokenize' return value check
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Mon, 23 Feb 2026 13:56:59 +0000 (14:56 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 6 Mar 2026 08:52:19 +0000 (09:52 +0100)
There was a "jwt_tokenize" call whose return value was not checked.

This was found by coverity and raised in GitHub #3277.
This patch can be backported to all stable branches.

src/sample.c

index f8150eaa53be633eed41506aaa5b4a04ef4fe4e1..07846caee77d07d52eed276536a05783a0ca573e 100644 (file)
@@ -4795,7 +4795,8 @@ static int sample_conv_jwt_member_query(const struct arg *args, struct sample *s
        int retval = 0;
        int ret;
 
-       jwt_tokenize(&smp->data.u.str, items, &item_num);
+       if (jwt_tokenize(&smp->data.u.str, items, &item_num))
+               goto end;
 
        if (item_num < member + 1)
                goto end;