]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: i_stream_read_next_line() now sets a better error message if line is too long.
authorTimo Sirainen <tss@iki.fi>
Tue, 14 Oct 2014 16:22:40 +0000 (09:22 -0700)
committerTimo Sirainen <tss@iki.fi>
Tue, 14 Oct 2014 16:22:40 +0000 (09:22 -0700)
src/lib/istream.c

index 2ef0c2d514de54826ef54473a46c1c6cdb8fe824..bcf59a300f44ba809ea3b5e9c1f629d0e33ceb49 100644 (file)
@@ -425,6 +425,10 @@ char *i_stream_read_next_line(struct istream *stream)
 
                switch (i_stream_read(stream)) {
                case -2:
+                       io_stream_set_error(&stream->real_stream->iostream,
+                               "Line is too long (over %"PRIuSIZE_T
+                               " bytes at offset %"PRIuUOFF_T")",
+                               i_stream_get_data_size(stream), stream->v_offset);
                        stream->stream_errno = errno = ENOBUFS;
                        stream->eof = TRUE;
                        return NULL;