Mercurial > dovecot > core-2.2
changeset 12211:dfa2b49d8298
auth: Avoid crashing when finishing failed requests that already timed out.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 30 Sep 2010 17:12:55 +0100 |
parents | 32f68d621f1d |
children | bc782780d0fe |
files | src/auth/auth-request-handler.c src/auth/auth-request.h |
diffstat | 2 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/auth/auth-request-handler.c Thu Sep 30 16:49:16 2010 +0100 +++ b/src/auth/auth-request-handler.c Thu Sep 30 17:12:55 2010 +0100 @@ -116,6 +116,12 @@ { i_assert(request->handler == handler); + if (request->removed_from_handler) { + /* already removed it */ + return; + } + request->removed_from_handler = TRUE; + /* if db lookup is stuck, this call doesn't actually free the auth request, so make sure we don't get back here. */ timeout_remove(&request->to_abort);
--- a/src/auth/auth-request.h Thu Sep 30 16:49:16 2010 +0100 +++ b/src/auth/auth-request.h Thu Sep 30 17:12:55 2010 +0100 @@ -109,6 +109,7 @@ unsigned int userdb_lookup:1; unsigned int userdb_lookup_failed:1; unsigned int secured:1; + unsigned int removed_from_handler:1; /* ... mechanism specific data ... */ };