Skip to content

Commit

Permalink
lib-compression: istream-{bzlib|lz4} - set stream_errno=EPIPE on unex…
Browse files Browse the repository at this point in the history
…pected EOF
  • Loading branch information
sirainen authored and GitLab committed Dec 23, 2016
1 parent a4883ee commit b7cabbb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib-compression/istream-bzlib.c
Expand Up @@ -106,7 +106,7 @@ static ssize_t i_stream_bzlib_read(struct istream_private *stream)
} else {
i_assert(stream->parent->eof);
bzlib_read_error(zstream, "unexpected EOF");
stream->istream.stream_errno = EINVAL;
stream->istream.stream_errno = EPIPE;
}
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib-compression/istream-lz4.c
Expand Up @@ -139,7 +139,7 @@ static ssize_t i_stream_lz4_read(struct istream_private *stream)
if (zstream->chunk_left > 0) {
if (ret == -1 && zstream->istream.parent->stream_errno == 0) {
lz4_read_error(zstream, "truncated lz4 chunk");
stream->istream.stream_errno = EINVAL;
stream->istream.stream_errno = EPIPE;
return -1;
}
zstream->istream.istream.stream_errno =
Expand Down

0 comments on commit b7cabbb

Please sign in to comment.