]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Added assert to iostream-temp
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 28 Jun 2016 18:59:26 +0000 (21:59 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 28 Jun 2016 18:59:26 +0000 (21:59 +0300)
Input stream isn't expected to shrink here. Potentially this could be
changed to an error instead.

src/lib/iostream-temp.c

index ddb0befbbd9fe5dedf7e3c7b906758f4caaed6c8..1b3583d5c037f0f37540d149b54c43188e70943e 100644 (file)
@@ -184,6 +184,7 @@ o_stream_temp_dup_istream(struct temp_ostream *outstream,
                        return o_stream_temp_dup_cancel(outstream, res_r);
                return FALSE;
        }
+       i_assert(instream->v_offset <= in_size);
 
        if (outstream->dupstream == NULL) {
                outstream->dupstream = instream;