need to subtract hdrlen from tree data in got_object_tree_open()
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 {