Commit 43a2d19da87aec49a3fddd3bf14d4e63d17520b2

Stefan Sperling 2018-03-16T19:28:52

need to subtract hdrlen from tree data in got_object_tree_open()

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/lib/object.c b/lib/object.c
index 1cd78bd..6ad23fc 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -701,6 +701,7 @@ got_object_tree_open(struct got_tree_object **tree,
 		err = got_packfile_extract_object_to_mem(&buf, &len, obj, repo);
 		if (err)
 			return err;
+		len -= obj->hdrlen;
 		err = parse_tree_object(tree, repo, buf + obj->hdrlen, len);
 		free(buf);
 	} else {