commit 0fca100c2fe2bfd8e88b22246068addedecd343d from: Omar Polo date: Tue Jun 14 13:16:15 2022 UTC compute object size, not pointer size in this case they're luckily the same; got_imsg_object_idlist and got_imsg_reused_delta only have one size_t long field. ok stsp@ commit - c98b0f0b57cce101941efd993eac8b9e3be2a70a commit + 0fca100c2fe2bfd8e88b22246068addedecd343d blob - 0524ef11c75a6736de2b1e1866663ad0304d4b44 blob + 85d1234ffdb9c7fc4b46eafa3080973bcc7b3327 --- lib/privsep.c +++ lib/privsep.c @@ -3170,7 +3170,7 @@ got_privsep_recv_object_idlist(int *done, struct got_o err = got_error_from_errno("calloc"); break; } - memcpy(*ids, (uint8_t *)imsg.data + sizeof(idlist), + memcpy(*ids, (uint8_t *)imsg.data + sizeof(*idlist), *nids * sizeof(**ids)); break; case GOT_IMSG_OBJ_ID_LIST_DONE: @@ -3272,7 +3272,7 @@ got_privsep_recv_reused_deltas(int *done, struct got_i break; } *ndeltas = ideltas->ndeltas; - memcpy(deltas, (uint8_t *)imsg.data + sizeof(ideltas), + memcpy(deltas, (uint8_t *)imsg.data + sizeof(*ideltas), *ndeltas * sizeof(*deltas)); break; case GOT_IMSG_DELTA_REUSE_DONE: