Commit e7242ceefd84094a2e7f3dc4a4eb7d6a557a7a78

Stefan Sperling 2018-07-09T15:59:44

less memset() needed in got_inflate_init()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/lib/zbuf.c b/lib/zbuf.c
index 85e1798..a66a9a6 100644
--- a/lib/zbuf.c
+++ b/lib/zbuf.c
@@ -38,7 +38,7 @@ got_inflate_init(struct got_zstream_buf *zb, uint8_t *outbuf, size_t bufsize)
 {
 	const struct got_error *err = NULL;
 
-	memset(zb, 0, sizeof(*zb));
+	memset(&zb->z, 0, sizeof(zb->z));
 
 	zb->z.zalloc = Z_NULL;
 	zb->z.zfree = Z_NULL;
@@ -55,6 +55,7 @@ got_inflate_init(struct got_zstream_buf *zb, uint8_t *outbuf, size_t bufsize)
 		goto done;
 	}
 
+	zb->flags = 0;
 	if (outbuf == NULL) {
 		zb->outbuf = calloc(1, zb->outlen);
 		if (zb->outbuf == NULL) {