dovecot-1.2: mail_index_map_ext_hdr_check(): Fixed a wrong check.
dovecot at dovecot.org
dovecot at dovecot.org
Tue Feb 24 23:55:38 EET 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/3bd20d70b0d6
changeset: 8776:3bd20d70b0d6
user: Timo Sirainen <tss at iki.fi>
date: Tue Feb 24 16:55:11 2009 -0500
description:
mail_index_map_ext_hdr_check(): Fixed a wrong check.
diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
src/lib-index/mail-index-map.c | 7 ++++---
diffs (24 lines):
diff -r 98e1115cd8f0 -r 3bd20d70b0d6 src/lib-index/mail-index-map.c
--- a/src/lib-index/mail-index-map.c Tue Feb 24 16:41:08 2009 -0500
+++ b/src/lib-index/mail-index-map.c Tue Feb 24 16:55:11 2009 -0500
@@ -169,7 +169,10 @@ int mail_index_map_ext_hdr_check(const s
return -1;
}
- if (ext_hdr->record_offset + ext_hdr->record_size > hdr->record_size) {
+ /* if we get here from extension introduction, record_offset=0 and
+ hdr->record_size hasn't been updated yet */
+ if (ext_hdr->record_offset != 0 &&
+ ext_hdr->record_offset + ext_hdr->record_size > hdr->record_size) {
*error_r = t_strdup_printf("Record field points "
"outside record size (%u+%u > %u)",
ext_hdr->record_offset,
@@ -184,8 +187,6 @@ int mail_index_map_ext_hdr_check(const s
"not used", ext_hdr->record_align);
return -1;
}
- /* if we get here from extension introduction, record_offset=0 and
- hdr->record_size hasn't been updated yet */
if (ext_hdr->record_offset != 0 &&
(hdr->record_size % ext_hdr->record_align) != 0) {
*error_r = t_strdup_printf("Record size not aligned by %u "
More information about the dovecot-cvs
mailing list