dovecot-2.2: lib-test: Fixed "Trying to allocate 0 bytes" assert...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jun 25 13:17:29 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/705fd8f3f485
changeset: 17516:705fd8f3f485
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jun 25 16:16:02 2014 +0300
description:
lib-test: Fixed "Trying to allocate 0 bytes" assert-crash caused by recent test-istream changes.

diffstat:

 src/lib-test/test-common.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 38cd37cea8b1 -r 705fd8f3f485 src/lib-test/test-common.c
--- a/src/lib-test/test-common.c	Fri Jun 20 12:18:32 2014 +0300
+++ b/src/lib-test/test-common.c	Wed Jun 25 16:16:02 2014 +0300
@@ -56,7 +56,7 @@
 
 		/* use exactly correct buffer size so valgrind can catch
 		   read overflows */
-		if (stream->buffer_size != cur_max) {
+		if (stream->buffer_size != cur_max && cur_max > 0) {
 			stream->w_buffer = i_realloc(stream->w_buffer, 0,
 						     cur_max);
 			stream->buffer = stream->w_buffer;


More information about the dovecot-cvs mailing list