From: Timo Sirainen Date: Fri, 2 Jul 2004 12:45:53 +0000 (+0300) Subject: make sure there's only LWSP after X-UID X-Git-Tag: 1.1.alpha1~3843 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eeed42e5603314ce98c01c92613ba869d50d72bd;p=thirdparty%2Fdovecot%2Fcore.git make sure there's only LWSP after X-UID --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/mbox/mbox-sync-parse.c b/src/lib-storage/index/mbox/mbox-sync-parse.c index 18a45aaffc..732b7d75cd 100644 --- a/src/lib-storage/index/mbox/mbox-sync-parse.c +++ b/src/lib-storage/index/mbox/mbox-sync-parse.c @@ -199,6 +199,13 @@ static int parse_x_uid(struct mbox_sync_mail_context *ctx, value = value*10 + (hdr->full_value[i] - '0'); } + for (; i < hdr->full_value_len; i++) { + if (!IS_LWSP_LF(hdr->full_value[i])) { + /* broken value */ + return FALSE; + } + } + if (value >= ctx->sync_ctx->next_uid) { /* next_uid broken - fix it */ ctx->sync_ctx->next_uid = value+1;