commit 6c77e0337609d941281f017b3e0229ae45a35b7a from: Omar Polo date: Sat Jul 02 21:21:52 2022 UTC fix imsg_add TREE_ENTRY: Result too large on i386 There's a math error when computing the size of one entries in the batching code. Reported by semarie, ok semarie stsp 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) {