From: Timo Sirainen Date: Mon, 3 May 2004 13:53:35 +0000 (+0300) Subject: don't access uninitialized memory X-Git-Tag: 1.1.alpha1~4143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af7342853786b5d0365b7ae5284a21f3eee364c5;p=thirdparty%2Fdovecot%2Fcore.git don't access uninitialized memory --HG-- branch : HEAD --- diff --git a/src/imap/imap-fetch-body-section.c b/src/imap/imap-fetch-body-section.c index dbbb60be2c..83e11fb5e8 100644 --- a/src/imap/imap-fetch-body-section.c +++ b/src/imap/imap-fetch-body-section.c @@ -366,9 +366,9 @@ static int fetch_header_from(struct imap_fetch_context *ctx, t_push(); /* first pass, we need at least the size */ - if (size->virtual_size > MAX_HEADER_BUFFER_SIZE && - body->max_size > MAX_HEADER_BUFFER_SIZE && - !ctx->body_fetch_from_cache) { + if (!ctx->body_fetch_from_cache && + size->virtual_size > MAX_HEADER_BUFFER_SIZE && + body->max_size > MAX_HEADER_BUFFER_SIZE) { if (!fetch_header_fields(input, header_section, &hdr_ctx)) failed = TRUE; @@ -420,9 +420,10 @@ static int fetch_header(struct imap_fetch_context *ctx, struct mail *mail, struct istream *stream; struct message_size hdr_size; - if (ctx->body_fetch_from_cache) + if (ctx->body_fetch_from_cache) { + memset(&hdr_size, 0, sizeof(hdr_size)); stream = NULL; - else { + } else { stream = mail->get_stream(mail, &hdr_size, NULL); if (stream == NULL) return FALSE;