]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Fixed assert-crash on invalid auth-client input
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 20 Oct 2016 13:30:58 +0000 (16:30 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 20 Oct 2016 20:04:41 +0000 (23:04 +0300)
For example if client sends invalid input like:
auth: Error: BUG: Authentication client sent unknown command: XYZ

Fixes crash:
auth: Panic: key not found from hash

src/auth/auth-request-handler.c

index 415b06d68b2c9d0a9401d21275da5632ed9c5cfa..880d1cb9ca8fffe8de54bdc53f229705c44b8a2f 100644 (file)
@@ -81,6 +81,7 @@ void auth_request_handler_abort_requests(struct auth_request_handler *handler)
                case AUTH_REQUEST_STATE_NEW:
                case AUTH_REQUEST_STATE_MECH_CONTINUE:
                case AUTH_REQUEST_STATE_FINISHED:
+                       auth_request->removed_from_handler = TRUE;
                        auth_request_unref(&auth_request);
                        hash_table_remove(handler->requests, key);
                        break;