commit 623d55de6ed896de2a4767bd1866fa78326e08c4 from: Omar Polo via: Thomas Adam date: Thu Jun 23 14:09:34 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 - 31d32634997bd59472b751d9fea87298edee75be commit + 623d55de6ed896de2a4767bd1866fa78326e08c4 blob - c1fb41744c3c30d9161cbdf76486db46fc6fddff blob + cf4eba7c1704b303aff803e26b76d4e0cd628f9c --- lib/privsep.c +++ lib/privsep.c @@ -3169,7 +3169,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: @@ -3271,7 +3271,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: