From: Martti Rannanjärvi Date: Tue, 7 Jun 2022 06:40:10 +0000 (+0300) Subject: auth: db_oauth2_have_all_fields() - Fix auth field existence check X-Git-Tag: 2.3.20~56 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f0a9cbfb9d7f9511ebafc5532ba3a3fd1d4bf911;p=thirdparty%2Fdovecot%2Fcore.git auth: db_oauth2_have_all_fields() - Fix auth field existence check 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. --- diff --git a/src/auth/db-oauth2.c b/src/auth/db-oauth2.c index 3c6ef3acb9..4ea699b62b 100644 --- a/src/auth/db-oauth2.c +++ b/src/auth/db-oauth2.c @@ -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; }