From: Timo Sirainen Date: Wed, 20 Nov 2013 12:50:53 +0000 (+0200) Subject: lib-storage: mail_get_*header*() still didn't handle cached values correctly. X-Git-Tag: 2.2.9~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3411c496000d3e2797b43a33584dfba954e815e;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: mail_get_*header*() still didn't handle cached values correctly. If header ends with ":", the ":" shouldn't be returned as part of the value. --- diff --git a/src/lib-storage/index/index-mail-headers.c b/src/lib-storage/index/index-mail-headers.c index 75c452cd52..59d94d89ae 100644 --- a/src/lib-storage/index/index-mail-headers.c +++ b/src/lib-storage/index/index-mail-headers.c @@ -653,8 +653,8 @@ index_mail_get_raw_headers(struct index_mail *mail, const char *field, /* cached. skip "header name: " parts in dest. */ for (i = 0; i < len; i++) { if (data[i] == ':') { - while (IS_LWSP(data[i+1])) i++; - if (i+1 != len) i++; + i++; + while (i < len && IS_LWSP(data[i])) i++; /* @UNSAFE */ len = get_header_size(dest, i);