From eeed42e5603314ce98c01c92613ba869d50d72bd Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 2 Jul 2004 15:45:53 +0300 Subject: [PATCH] make sure there's only LWSP after X-UID --HG-- branch : HEAD --- src/lib-storage/index/mbox/mbox-sync-parse.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; -- 2.47.3