Commit 8baa7d2656b89e5d4536a655d0e6cfacdf32549a

Stefan Sperling 2020-03-17T10:25:06

retry on Z_BUF_ERROR in got_inflate_read() as well

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/inflate.c b/lib/inflate.c
index 1dfd4a7..a69a6ff 100644
--- a/lib/inflate.c
+++ b/lib/inflate.c
@@ -107,7 +107,7 @@ got_inflate_read(struct got_inflate_buf *zb, FILE *f, size_t *outlenp)
 		ret = inflate(z, Z_SYNC_FLUSH);
 	} while (ret == Z_OK && z->avail_out > 0);
 
-	if (ret == Z_OK) {
+	if (ret == Z_OK || ret == Z_BUF_ERROR) {
 		zb->flags |= GOT_INFLATE_F_HAVE_MORE;
 	} else {
 		if (ret != Z_STREAM_END)