# HG changeset patch # User Timo Sirainen # Date 1384952846 -7200 # Node ID 47923cfd4b5616f943c8e043c09e64e94b5c24f9 # Parent 4ef184875799baa65b4b6048ccde49eefbfd9050 lib-storage: mail_get_headers*() returned only the first header from cache. diff -r 4ef184875799 -r 47923cfd4b56 src/lib-storage/index/index-mail-headers.c --- a/src/lib-storage/index/index-mail-headers.c Wed Nov 20 14:50:53 2013 +0200 +++ b/src/lib-storage/index/index-mail-headers.c Wed Nov 20 15:07:26 2013 +0200 @@ -603,7 +603,7 @@ unsigned char *data; unsigned int field_idx; string_t *dest; - size_t i, len; + size_t i, len, len2; int ret; ARRAY(const char *) header_values; @@ -657,10 +657,10 @@ while (i < len && IS_LWSP(data[i])) i++; /* @UNSAFE */ - len = get_header_size(dest, i); - data[i + len] = '\0'; + len2 = get_header_size(dest, i); + data[i + len2] = '\0'; value = (const char *)data + i; - i += len + 1; + i += len2 + 1; array_append(&header_values, &value, 1); }