dovecot-2.2: Avoid overflow error from clang -fsanitize=integer.

dovecot at dovecot.org dovecot at dovecot.org
Sun Feb 24 11:58:58 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/11858b3dbd84
changeset: 15906:11858b3dbd84
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Feb 24 10:50:35 2013 +0200
description:
Avoid overflow error from clang -fsanitize=integer.

diffstat:

 src/lib/istream-crlf.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 76f576fc28dc -r 11858b3dbd84 src/lib/istream-crlf.c
--- a/src/lib/istream-crlf.c	Sun Feb 24 10:49:38 2013 +0200
+++ b/src/lib/istream-crlf.c	Sun Feb 24 10:50:35 2013 +0200
@@ -144,7 +144,7 @@
 			stream->w_buffer[dest++] = data[0];
 	}
 
-	diff = -1;
+	diff = 1;
 	for (i = 1; i < size && dest < stream->buffer_size; i++) {
 		if (data[i] == '\r') {
 			if (data[i-1] != '\r')
@@ -159,7 +159,7 @@
 
 		stream->w_buffer[dest++] = data[i];
 	}
-	cstream->pending_cr = data[i+diff] == '\r';
+	cstream->pending_cr = data[i-diff] == '\r';
 	i_stream_skip(stream->parent, i);
 
 	ret = dest - stream->pos;


More information about the dovecot-cvs mailing list