From b5322c8270616a28f2e65cb3a09580c410bb0941 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 2 Dec 2010 21:42:30 +0000 Subject: [PATCH] auth: Fail if auth client tries to use a duplicate ID. --- src/auth/auth-request-handler.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/auth/auth-request-handler.c b/src/auth/auth-request-handler.c index 1354970b8e..2d0f773e25 100644 --- a/src/auth/auth-request-handler.c +++ b/src/auth/auth-request-handler.c @@ -449,6 +449,12 @@ bool auth_request_handler_auth_begin(struct auth_request_handler *handler, auth_request_unref(&request); return FALSE; } + if (hash_table_lookup(handler->requests, POINTER_CAST(id)) != NULL) { + i_error("BUG: Authentication client %u " + "sent a duplicate ID %u", handler->client_pid, id); + auth_request_unref(&request); + return FALSE; + } auth_request_init(request); request->to_abort = timeout_add(MASTER_AUTH_SERVER_TIMEOUT_SECS * 1000, -- 2.47.3