]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: istream-try - Fix off-by-one check for min_buffer_full_size
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 10 Sep 2020 07:16:56 +0000 (10:16 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 10 Sep 2020 07:16:56 +0000 (10:16 +0300)
This mainly fixes random failures with the unit test.

src/lib/istream-try.c

index 1a31a7fb69e63338e354fd19a7b0e7aa9aaf908d..c22ee4dbe721dc16434107e1f165986b84442ffa 100644 (file)
@@ -64,7 +64,7 @@ i_stream_try_is_buffer_full(struct try_istream *tstream,
        while (try_input->real_stream->parent != NULL) {
                try_input = try_input->real_stream->parent;
                if (try_input->real_stream->pos >= try_input->real_stream->buffer_size &&
-                   try_input->real_stream->pos > tstream->min_buffer_full_size)
+                   try_input->real_stream->pos >= tstream->min_buffer_full_size)
                        return TRUE;
        }
        return FALSE;