]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-compression: bench-compress - Ensure we have both istream and ostream constructor
authorAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 14 Sep 2021 07:33:50 +0000 (10:33 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Sep 2021 05:46:51 +0000 (05:46 +0000)
After 6e5ae5ef0f0f31acd7bde0db53980a708c81eced we have read-only compression
mechanism, that leads to null pointer crash in bench-compress.

src/lib-compression/bench-compression.c

index f0e64268e524a7fc4a3dba73e0d49caf2fbade8f..655079ddb61c63ab5e09df3881010b634b8e3421 100644 (file)
@@ -154,7 +154,8 @@ int main(int argc, const char *argv[])
        printf("Input data constructed          \n");
 
        for (unsigned int i = 0; compression_handlers[i].name != NULL; i++) T_BEGIN {
-               if (compression_handlers[i].create_istream != NULL) {
+               if (compression_handlers[i].create_istream != NULL &&
+                   compression_handlers[i].create_ostream != NULL) {
                        bench_compression_speed(&compression_handlers[i], level,
                                                block_count);
                }