dovecot-1.0: mail_get_headers() returned bad data when headers w...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Nov 21 13:24:36 EET 2007
details: http://hg.dovecot.org/dovecot-1.0/rev/b3ec814cc791
changeset: 5459:b3ec814cc791
user: Timo Sirainen <tss at iki.fi>
date: Wed Nov 21 13:24:25 2007 +0200
description:
mail_get_headers() returned bad data when headers were already cached.
Dovecot doesn't use this function internally, but it might have caused
crashes with Sieve plugin.
diffstat:
1 file changed, 6 insertions(+), 8 deletions(-)
src/lib-storage/index/index-mail-headers.c | 14 ++++++--------
diffs (31 lines):
diff -r 73a3a6b1af36 -r b3ec814cc791 src/lib-storage/index/index-mail-headers.c
--- a/src/lib-storage/index/index-mail-headers.c Sun Nov 18 20:13:59 2007 +0200
+++ b/src/lib-storage/index/index-mail-headers.c Wed Nov 21 13:24:25 2007 +0200
@@ -508,8 +508,7 @@ index_mail_get_parsed_header(struct inde
}
}
- value = NULL;
- array_append(&header_values, &value, sizeof(value));
+ (void)array_append_space(&header_values);
return array_idx(&header_values, 0);
}
@@ -577,12 +576,11 @@ const char *const *index_mail_get_header
value = (const char *)data + i;
i += len + 1;
- array_append(&header_values, &value, sizeof(value));
- }
- }
-
- value = NULL;
- array_append(&header_values, &value, sizeof(value));
+ array_append(&header_values, &value, 1);
+ }
+ }
+
+ (void)array_append_space(&header_values);
return array_idx(&header_values, 0);
}
More information about the dovecot-cvs
mailing list