]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-compression: ostream-zstd - Fix assert on value range
authorAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 13 Apr 2021 09:45:23 +0000 (12:45 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 13 Apr 2021 10:25:08 +0000 (10:25 +0000)
src/lib-compression/ostream-zstd.c

index fa248ee98be3cc6f91c0d4f088bed9ab70a40767..35bcbeba8e129c4222506514ef6202061412117d 100644 (file)
@@ -216,7 +216,8 @@ o_stream_create_zstd(struct ostream *output, int level)
        struct zstd_ostream *zstream;
        size_t ret;
 
-       i_assert(level >= 1 && level <= ZSTD_maxCLevel());
+       i_assert(level >= compression_get_min_level_zstd() &&
+                level <= compression_get_max_level_zstd());
 
        zstd_version_check();