dovecot-2.0: auth: Avoid crashing when finishing failed requests...

dovecot at dovecot.org dovecot at dovecot.org
Thu Sep 30 19:13:27 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/dfa2b49d8298
changeset: 12211:dfa2b49d8298
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Sep 30 17:12:55 2010 +0100
description:
auth: Avoid crashing when finishing failed requests that already timed out.

diffstat:

 src/auth/auth-request-handler.c |  6 ++++++
 src/auth/auth-request.h         |  1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diffs (27 lines):

diff -r 32f68d621f1d -r dfa2b49d8298 src/auth/auth-request-handler.c
--- 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);
diff -r 32f68d621f1d -r dfa2b49d8298 src/auth/auth-request.h
--- 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 ... */
 };


More information about the dovecot-cvs mailing list