From d60ff60a7596df454560565016196182314e4419 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Mon, 3 Oct 2016 10:08:31 +0300 Subject: [PATCH] lib-test: Fix illegal memory access in test-ostream --- src/lib-test/test-ostream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.47.3