Commit f16c2465a5657c2f3c9fa37dbd721b500004edd0

Stefan Sperling 2019-04-11T21:53:11

don't forget to write header in got_object_blob_create()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/lib/object_create.c b/lib/object_create.c
index 942f76d..057e1ae 100644
--- a/lib/object_create.c
+++ b/lib/object_create.c
@@ -81,6 +81,11 @@ got_object_blob_create(struct got_object_id **id, struct got_repository *repo,
 	if (err)
 		goto done;
 
+	outlen = fwrite(header, 1, strlen(header) + 1, blobfile);
+	if (outlen != strlen(header) + 1) {
+		err = got_ferror(blobfile, GOT_ERR_IO);
+		goto done;
+	}
 	while (1) {
 		char buf[8192];
 		ssize_t inlen;