Commit cd9e913a519ca48be54195fcef0ca549caf977d9

Stefan Sperling 2019-11-27T01:34:30

pre-allocate the correct amount of memory in got_privsep_send_tree()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/privsep.c b/lib/privsep.c
index 72b117b..c2e79e1 100644
--- a/lib/privsep.c
+++ b/lib/privsep.c
@@ -716,7 +716,7 @@ got_privsep_send_tree(struct imsgbuf *ibuf, struct got_pathlist_head *entries,
 		struct got_parsed_tree_entry *pte = pe->data;
 		struct ibuf *wbuf;
 		size_t namelen = strlen(name);
-		size_t len = sizeof(struct got_imsg_tree_object) + namelen;
+		size_t len = sizeof(struct got_imsg_tree_entry) + namelen;
 
 		if (len > MAX_IMSGSIZE)
 			return got_error(GOT_ERR_NO_SPACE);