From 7cd7bd65aba6d84f4e4f5066d248437eaa4e5e54 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 21 Oct 2010 18:27:38 +0100 Subject: [PATCH] lib-storage: Make sure POP3 UIDLs aren't tried to be saved with LFs. --- src/lib-storage/index/dbox-common/dbox-save.c | 1 + src/lib-storage/mail-storage.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/lib-storage/index/dbox-common/dbox-save.c b/src/lib-storage/index/dbox-common/dbox-save.c index c5fee812ab..52d7d08a6c 100644 --- a/src/lib-storage/index/dbox-common/dbox-save.c +++ b/src/lib-storage/index/dbox-common/dbox-save.c @@ -147,6 +147,7 @@ void dbox_save_write_metadata(struct mail_save_context *_ctx, 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 --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index 4c18c438ad..a82a1e0606 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -1357,6 +1357,7 @@ void mailbox_save_set_guid(struct mail_save_context *ctx, const char *guid) 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); -- 2.47.3