]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: o_stream_copy_error_from_parent() - Assert-crash if source stream_errno is 0
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 24 Sep 2021 15:59:29 +0000 (18:59 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 30 Sep 2021 17:08:11 +0000 (17:08 +0000)
This can help debug situations where error is missing.

src/lib/ostream.c

index eab68937a4995a19a3339bdd2ea82f478c14b2b9..2f9c49dd9d87f5995a0b7f6da5369f1e6587b860 100644 (file)
@@ -571,6 +571,8 @@ void o_stream_copy_error_from_parent(struct ostream_private *_stream)
        struct ostream *src = _stream->parent;
        struct ostream *dest = &_stream->ostream;
 
+       i_assert(src->stream_errno != 0);
+
        dest->stream_errno = src->stream_errno;
        dest->overflow = src->overflow;
        if (src->closed)