dovecot-2.0: doveadm: Table formatter crashed with large output.

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 21 17:26:04 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/542d859f0223
changeset: 11590:542d859f0223
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 21 15:26:00 2010 +0100
description:
doveadm: Table formatter crashed with large output.

diffstat:

 src/doveadm/doveadm-print-table.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r 573cb66e9180 -r 542d859f0223 src/doveadm/doveadm-print-table.c
--- a/src/doveadm/doveadm-print-table.c	Sat Jun 19 20:57:42 2010 +0100
+++ b/src/doveadm/doveadm-print-table.c	Mon Jun 21 15:26:00 2010 +0100
@@ -154,8 +154,12 @@
 
 static void doveadm_print_table_print(const char *value)
 {
+	unsigned int line_count;
+
 	if (!ctx->lengths_set) {
-		if (array_count(&ctx->buffered_values) < MAX_BUFFER_LINES) {
+		line_count = array_count(&ctx->buffered_values) /
+			array_count(&ctx->headers);
+		if (line_count < MAX_BUFFER_LINES) {
 			value = p_strdup(ctx->pool, value);
 			array_append(&ctx->buffered_values, &value, 1);
 			return;


More information about the dovecot-cvs mailing list