changeset 12330:3959ddbc633c

lib-storage: Make sure POP3 UIDLs aren't tried to be saved with LFs.
author Timo Sirainen <tss@iki.fi>
date Thu, 21 Oct 2010 18:27:38 +0100
parents f38e4e1465c8
children 4f90256c0e9c
files src/lib-storage/index/dbox-common/dbox-save.c src/lib-storage/mail-storage.c
diffstat 2 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);
 	}
--- 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);