dovecot-2.0: lib-storage: Make sure POP3 UIDLs aren't tried to b...

dovecot at dovecot.org dovecot at dovecot.org
Thu Oct 21 20:28:15 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/3959ddbc633c
changeset: 12330:3959ddbc633c
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Oct 21 18:27:38 2010 +0100
description:
lib-storage: Make sure POP3 UIDLs aren't tried to be saved with LFs.

diffstat:

 src/lib-storage/index/dbox-common/dbox-save.c |  1 +
 src/lib-storage/mail-storage.c                |  1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diffs (22 lines):

diff -r f38e4e1465c8 -r 3959ddbc633c src/lib-storage/index/dbox-common/dbox-save.c
--- a/src/lib-storage/index/dbox-common/dbox-save.c	Thu Oct 21 17:12:19 2010 +0100
+++ b/src/lib-storage/index/dbox-common/dbox-save.c	Thu Oct 21 18:27:38 2010 +0100
@@ -147,6 +147,7 @@
 	str_printfa(str, "%c%llx\n", DBOX_METADATA_VIRTUAL_SIZE,
 		    (unsigned long long)vsize);
 	if (_ctx->pop3_uidl != NULL) {
+		i_assert(strchr(_ctx->pop3_uidl, '\n') == NULL);
 		str_printfa(str, "%c%s\n", DBOX_METADATA_POP3_UIDL,
 			    _ctx->pop3_uidl);
 	}
diff -r f38e4e1465c8 -r 3959ddbc633c src/lib-storage/mail-storage.c
--- a/src/lib-storage/mail-storage.c	Thu Oct 21 17:12:19 2010 +0100
+++ b/src/lib-storage/mail-storage.c	Thu Oct 21 18:27:38 2010 +0100
@@ -1357,6 +1357,7 @@
 void mailbox_save_set_pop3_uidl(struct mail_save_context *ctx, const char *uidl)
 {
 	i_assert(*uidl != '\0');
+	i_assert(strchr(uidl, '\n') == NULL);
 
 	i_free(ctx->pop3_uidl);
 	ctx->pop3_uidl = i_strdup(uidl);


More information about the dovecot-cvs mailing list