]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: mail_get_*header*() still didn't handle cached values correctly.
authorTimo Sirainen <tss@iki.fi>
Wed, 20 Nov 2013 12:50:53 +0000 (14:50 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 20 Nov 2013 12:50:53 +0000 (14:50 +0200)
If header ends with ":", the ":" shouldn't be returned as part of the value.

src/lib-storage/index/index-mail-headers.c

index 75c452cd520eb10b3d8e6eef0d03c5e5b6131c66..59d94d89aee9ad208d58e0d4482a07ca1e6387ba 100644 (file)
@@ -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);