Commit 13f977b46069aaea2cc3228fa7667772c7eb7ac0

Stefan Sperling 2018-11-17T13:14:21

Set output to NULL if got_object_parse_tree() fails.

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/lib/object_parse.c b/lib/object_parse.c
index fea89ac..0c8445c 100644
--- a/lib/object_parse.c
+++ b/lib/object_parse.c
@@ -511,6 +511,7 @@ got_object_parse_tree(struct got_tree_object **tree, uint8_t *buf, size_t len)
 
 	if (remain != 0) {
 		got_object_tree_close(*tree);
+		*tree = NULL;
 		return got_error(GOT_ERR_BAD_OBJ_DATA);
 	}