]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-compression: test-compression - Fix test buffer size in partial write test
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 12 Mar 2020 11:48:36 +0000 (13:48 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 12 Mar 2020 12:01:32 +0000 (14:01 +0200)
The buffer size does not match the amount of data filled.

Found by valgrind.

src/lib-compression/test-compression.c

index 602132243083bc0c3823aa415e5fb7f0a76ddc56..9096ae522ff052b3884c1fc25c11d4f9c8201c39 100644 (file)
@@ -336,9 +336,9 @@ static void test_compression_handler_partial_parent_write(const struct compressi
        struct ostream *os_compressed = handler->create_ostream(os, 9);
        o_stream_unref(&os);
 
-       unsigned char input_buffer[256];
+       unsigned char input_buffer[64];
        /* create unlikely compressible data */
-       random_fill(input_buffer, 64);
+       random_fill(input_buffer, sizeof(input_buffer));
 
        for (unsigned int i = 0; i < 10; i++) {
                /* write it to stream */