dovecot-2.2: anvil: Penalty tracking was moving last checksums w...

dovecot at dovecot.org dovecot at dovecot.org
Sat May 9 16:52:10 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/398d94f08407
changeset: 18617:398d94f08407
user:      Timo Sirainen <tss at iki.fi>
date:      Sat May 09 19:50:14 2015 +0300
description:
anvil: Penalty tracking was moving last checksums wrongly with memcpy().
Depending on the OS/etc this could have caused the checksum tracking to go
wrong. Found by Coverity.

diffstat:

 src/anvil/penalty.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (14 lines):

diff -r e702b7a745e0 -r 398d94f08407 src/anvil/penalty.c
--- a/src/anvil/penalty.c	Sat May 09 19:41:45 2015 +0300
+++ b/src/anvil/penalty.c	Sat May 09 19:50:14 2015 +0300
@@ -105,8 +105,8 @@
 	for (i = 0; i < count; i++) {
 		if (checksums[i] == checksum) {
 			if (i > 0) {
-				memcpy(checksums + 1, checksums,
-				       sizeof(checksums[0]) * i);
+				memmove(checksums + 1, checksums,
+					sizeof(checksums[0]) * i);
 				checksums[0] = checksum;
 			}
 			return TRUE;


More information about the dovecot-cvs mailing list