]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-test: Fix illegal memory access in test-ostream
authorAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 3 Oct 2016 07:08:31 +0000 (10:08 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 13 Oct 2016 08:20:05 +0000 (10:20 +0200)
src/lib-test/test-ostream.c

index 0eb5d30f5986ab43a288e4c47f1a5a5cca5e8fe6..4a5664ac7cf63c7757395c08d4af09ef367bbe48 100644 (file)
@@ -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;