changeset 2753:cc35dc9b9cdf HEAD

extra assert
author Timo Sirainen <tss@iki.fi>
date Sat, 16 Oct 2004 01:56:10 +0300
parents 3a195d649a73
children 3c3ac12be307
files src/auth/mech.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/mech.c	Sat Oct 16 01:55:35 2004 +0300
+++ b/src/auth/mech.c	Sat Oct 16 01:56:10 2004 +0300
@@ -118,6 +118,13 @@
 	if (!success) {
 		/* failure. don't announce it immediately to avoid
 		   a) timing attacks, b) flooding */
+		if (auth_failures_buf->used > 0) {
+			const struct auth_request *const *requests;
+
+			requests = auth_failures_buf->data;
+			requests += auth_failures_buf->used/sizeof(*requests)-1;
+			i_assert(*requests != request);
+		}
 		buffer_append(auth_failures_buf, &request, sizeof(request));
 		return;
 	}