dovecot-2.0: str_append_unescaped() didn't unescape \\ correctly.

dovecot at dovecot.org dovecot at dovecot.org
Tue Jun 16 20:40:01 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/464116e1d0ae
changeset: 9483:464116e1d0ae
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jun 16 13:39:40 2009 -0400
description:
str_append_unescaped() didn't unescape \\ correctly.
The function wasn't used anywhere in Dovecot though.

diffstat:

1 file changed, 5 insertions(+), 2 deletions(-)
src/lib/strescape.c |    7 +++++--

diffs (17 lines):

diff -r d4ad8009a18b -r 464116e1d0ae src/lib/strescape.c
--- a/src/lib/strescape.c	Mon Jun 15 23:14:25 2009 -0400
+++ b/src/lib/strescape.c	Tue Jun 16 13:39:40 2009 -0400
@@ -44,8 +44,11 @@ void str_append_unescaped(string_t *dest
 
 		str_append_n(dest, src_c + start, i-start);
 
-		if (i < src_size)
-			i++;
+		if (i < src_size) {
+			if (++i == src_size)
+				break;
+			str_append_c(dest, src_c[i++]);
+		}
 		start = i;
 	}
 }


More information about the dovecot-cvs mailing list