Commit Diff


commit - 501834af38124c2210b66fa6705cc0890781b539
commit + 6c77e0337609d941281f017b3e0229ae45a35b7a
blob - c0bdac7221a79c5ec97d1728e862406152d51eb9
blob + 5655e967b5d1a0320fe3e1ef6184b52da9adc4d8
--- lib/privsep.c
+++ lib/privsep.c
@@ -1471,7 +1471,8 @@ send_tree_entries(struct imsgbuf *ibuf, struct got_par
 	i = 0;
 	for (j = 0; j < nentries; j++) {
 		struct got_parsed_tree_entry *pte = &entries[j];
-		size_t len = sizeof(*pte) + pte->namelen;
+		size_t len = SHA1_DIGEST_LENGTH + sizeof(pte->mode) +
+		    sizeof(pte->namelen) + pte->namelen;
 
 		if (j > 0 &&
 		    entries_len + len > MAX_IMSGSIZE - IMSG_HEADER_SIZE) {