From: Aki Tuomi Date: Mon, 3 Oct 2016 07:08:31 +0000 (+0300) Subject: lib-test: Fix illegal memory access in test-ostream X-Git-Tag: 2.2.26~189 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=35fa25c7989c44c9bb49a0552880f4bff0a5ed6c;p=thirdparty%2Fdovecot%2Fcore.git lib-test: Fix illegal memory access in test-ostream --- diff --git a/src/lib-test/test-ostream.c b/src/lib-test/test-ostream.c index 0eb5d30f59..4a5664ac7c 100644 --- a/src/lib-test/test-ostream.c +++ b/src/lib-test/test-ostream.c @@ -82,7 +82,8 @@ o_stream_test_sendv(struct ostream_private *stream, ret += n; if (n != cur_iov.iov_len) break; - cur_iov = iov[++i]; + if (++i < iov_count) + cur_iov = iov[i]; } while (i < iov_count); tstream->flush_pending = TRUE;