]> dgit.raspbian.org Git - dovecot.git/commitdiff
[PATCH 1/4] lib-mail: o_stream_dot_sendv() - Use I_MIN()
authorMarco Bettini <marco.bettini@open-xchange.com>
Fri, 10 Apr 2026 08:53:36 +0000 (08:53 +0000)
committerNoah Meyerhans <noahm@debian.org>
Wed, 16 Sep 2026 19:06:35 +0000 (15:06 -0400)
Gbp-Pq: Name 0001-lib-mail-o_stream_dot_sendv-Use-I_MIN.patch

src/lib-mail/ostream-dot.c

index 4fa868b567d67661bc5e63f36cd6e543a4390608..6bc9aa23d3409adcfc0b81014a643af47c419c2f 100644 (file)
@@ -198,8 +198,7 @@ o_stream_dot_sendv(struct ostream_private *stream,
                if (max_bytes == 0)
                        break;
                i_assert(p <= pend);
-               chunk = ((size_t)(p-data) >= max_bytes ?
-                               max_bytes : (size_t)(p - data));
+               chunk = I_MIN((size_t)(p - data), max_bytes);
                if (chunk > 0) {
                        iovn.iov_base = data;
                        iovn.iov_len = chunk;