]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: db_oauth2_have_all_fields() - Fix auth field existence check
authorMartti Rannanjärvi <martti.rannanjarvi@open-xchange.com>
Tue, 7 Jun 2022 06:40:10 +0000 (09:40 +0300)
committerMartti Rannanjärvi <martti.rannanjarvi@open-xchange.com>
Tue, 7 Jun 2022 07:08:58 +0000 (10:08 +0300)
The correct pointer to pass on there is field, since ptr is the original
which still includes the ending }.

Broken in 9b670175445a75987a713ff899d1a945255b0b5b and incorrectly fixed
in 5c2f3d0b85830d18dbb8b45b348da091e24d1b3b.

src/auth/db-oauth2.c

index 3c6ef3acb9d2538a091037bc3e7ef0569211ce01..4ea699b62b16dc69c06b799f00fa6ac33177fad0 100644 (file)
@@ -395,7 +395,7 @@ db_oauth2_have_all_fields(struct db_oauth2_request *req)
                                ptr = ptr+idx;
                                field = t_strndup(ptr,size);
                                if (str_begins(field, "oauth2:") &&
-                                   !auth_fields_exists(req->fields, ptr+7))
+                                   !auth_fields_exists(req->fields, field+7))
                                        return FALSE;
                                ptr = ptr+size;
                        }