Skip to content

Commit

Permalink
lib: Fixed crash when closing a failed istream-concat
Browse files Browse the repository at this point in the history
i_stream_concat_seek() could have set cur_input==NULL and we still
attempted to seek the cur_input at close time.
  • Loading branch information
sirainen committed May 19, 2016
1 parent 4d30a2d commit ad66167
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/istream-concat.c
Expand Up @@ -23,7 +23,10 @@ static void i_stream_concat_close(struct iostream_private *stream,
struct concat_istream *cstream = (struct concat_istream *)stream;
unsigned int i;

(void)i_stream_concat_skip(cstream);
if (cstream->istream.istream.stream_errno == 0) {
/* get the parent streams to the wanted offset */
(void)i_stream_concat_skip(cstream);
}

if (close_parent) {
for (i = 0; cstream->input[i] != NULL; i++)
Expand Down

0 comments on commit ad66167

Please sign in to comment.