]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Fix crash when OAUTH token validation failed with oauth2_use_worker_with_mech=yes
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 27 Jun 2025 11:31:27 +0000 (14:31 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Sat, 28 Jun 2025 16:21:22 +0000 (16:21 +0000)
auth_request had already been freed, and also mech_event is NULL in worker.

Broken by 76cc978202c4a53fb83eca84b647ed6e19af6308

src/auth/auth-worker-server.c

index ffeaca43a821bb5f48294212e4618914e34cd7f6..118a0c68de6fb48ce5584a427cda927308c6f11b 100644 (file)
@@ -786,9 +786,9 @@ static void auth_worker_handle_token_continue(struct db_oauth2_request *db_reque
        if (error != NULL)
                error = t_strconcat("oauth2 failed: ", error, NULL);
        if (result == PASSDB_RESULT_INTERNAL_FAILURE)
-               e_error(auth_request->mech_event, "%s", error);
+               e_error(cmd->event, "%s", error);
        else if (result != PASSDB_RESULT_OK)
-               e_info(auth_request->mech_event, "%s", error);
+               e_info(cmd->event, "%s", error);
        auth_worker_request_finished(cmd, error);
 }