commit - 5eb14fb9cee55bc3df623de8761d1e719ae697d4
commit + 427f294cd8765e673b3d562140ee3c5b895249fc
blob - 1face8ad5d73a913a43cc2f7586b6c1922ea5ec4
blob + 151e0d73fa443289c8609863654c6bef6d128723
--- lib/got_lib_privsep.h
+++ lib/got_lib_privsep.h
/* Structure for GOT_IMSG_SEND_REMOTE_REF data. */
struct got_imsg_send_remote_ref {
- uint8_t id[SHA1_DIGEST_LENGTH];
+ struct got_object_id id;
size_t name_len;
/* Followed by name_len data bytes. */
} __attribute__((__packed__));
blob - 486273f87d27a716cd1cadfc39e0d0f612116981
blob + 970978560467422ed3a634b6c3b86e48e6b49fd0
--- lib/privsep.c
+++ lib/privsep.c
err = got_error_from_errno("malloc");
goto done;
}
- memcpy(id->sha1, iremote_ref.id, SHA1_DIGEST_LENGTH);
+ memcpy(id, &iremote_ref.id, sizeof(*id));
refname = strndup(imsg.data + sizeof(iremote_ref),
datalen - sizeof(iremote_ref));
if (refname == NULL) {
blob - fc0bd390dcef939a8f1e78602a5314b33713e0fd
blob + 0fd0e6b2e84bfc5519482bd5ae802897596069f2
--- libexec/got-send-pack/got-send-pack.c
+++ libexec/got-send-pack/got-send-pack.c
return got_error_from_errno("imsg_create SEND_REMOTE_REF");
/* Keep in sync with struct got_imsg_send_remote_ref definition! */
- if (imsg_add(wbuf, refid->sha1, SHA1_DIGEST_LENGTH) == -1)
+ if (imsg_add(wbuf, refid, sizeof(*refid)) == -1)
return got_error_from_errno("imsg_add SEND_REMOTE_REF");
if (imsg_add(wbuf, &reflen, sizeof(reflen)) == -1)
return got_error_from_errno("imsg_add SEND_REMOTE_REF");