From: Timo Sirainen Date: Fri, 27 Jun 2025 11:31:27 +0000 (+0300) Subject: auth: Fix crash when OAUTH token validation failed with oauth2_use_worker_with_mech=yes X-Git-Tag: 2.4.2~693 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3e3f9bbbdcec1867766b637bbef8301ed1ac5f9;p=thirdparty%2Fdovecot%2Fcore.git auth: Fix crash when OAUTH token validation failed with oauth2_use_worker_with_mech=yes auth_request had already been freed, and also mech_event is NULL in worker. Broken by 76cc978202c4a53fb83eca84b647ed6e19af6308 --- diff --git a/src/auth/auth-worker-server.c b/src/auth/auth-worker-server.c index ffeaca43a8..118a0c68de 100644 --- a/src/auth/auth-worker-server.c +++ b/src/auth/auth-worker-server.c @@ -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); }