]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: test-istream-multiplex - Fix randomly trying to create 0 length variable array
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 1 Sep 2025 11:14:39 +0000 (14:14 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 1 Sep 2025 11:14:39 +0000 (14:14 +0300)
Fixes:
test-istream-multiplex.c:184:29: runtime error: variable length array bound evaluates to non-positive value 0

src/lib/test-istream-multiplex.c

index 443cb8b74828da3e29bf113001cff1370efb915b..f8f908675e20423c62a39bc0dcf7060afccfe460 100644 (file)
@@ -180,7 +180,7 @@ static void test_istream_multiplex_random(bool packet)
        if (!packet)
                buffer_append(buf, stream_header, sizeof(stream_header)-1);
        for (i = 0; i < packets_count; i++) {
-               unsigned int len = i_rand_limit((ON_VALGRIND ? 128 : 1024) + 1);
+               unsigned int len = i_rand_limit(ON_VALGRIND ? 128 : 1024) + 1;
                unsigned char packet_data[len];
                uint32_t len_be = cpu32_to_be(len);
                unsigned int channel = i_rand_limit(max_channel);