dovecot-1.1: array_idx_clear() was broken when clearing an index...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Apr 20 21:43:32 EEST 2009
details: http://hg.dovecot.org/dovecot-1.1/rev/d36c3ec2b274
changeset: 8250:d36c3ec2b274
user: Timo Sirainen <tss at iki.fi>
date: Mon Apr 20 14:43:15 2009 -0400
description:
array_idx_clear() was broken when clearing an index outside the existing array.
diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
src/lib/array.c | 3 ++-
diffs (13 lines):
diff -r b217c085ba15 -r d36c3ec2b274 src/lib/array.c
--- a/src/lib/array.c Mon Apr 20 12:17:59 2009 -0400
+++ b/src/lib/array.c Mon Apr 20 14:43:15 2009 -0400
@@ -35,7 +35,8 @@ void array_idx_clear_i(struct array *arr
pos = idx * array->element_size;
if (pos > array->buffer->used) {
/* index doesn't exist yet, initialize with zero */
- buffer_append_zero(array->buffer, pos - array->buffer->used);
+ buffer_append_zero(array->buffer, pos - array->buffer->used +
+ array->element_size);
} else {
buffer_write_zero(array->buffer, pos, array->element_size);
}
More information about the dovecot-cvs
mailing list