Commit 0fca100c2fe2bfd8e88b22246068addedecd343d

Omar Polo 2022-06-14T13:16:15

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@

diff --git a/lib/privsep.c b/lib/privsep.c
index 0524ef1..85d1234 100644
--- a/lib/privsep.c
+++ b/lib/privsep.c
@@ -3170,7 +3170,7 @@ got_privsep_recv_object_idlist(int *done, struct got_object_id **ids,
 			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_imsg_reused_delta *deltas,
 			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: