commit 5eb14fb9cee55bc3df623de8761d1e719ae697d4 from: Omar Polo date: Wed Feb 01 13:46:08 2023 UTC got_imsg_send_ref: use struct instead of buffer for id ok stsp@ commit - 0701e66c20d0558f1f7c72d7fb700be6fe376d3f commit + 5eb14fb9cee55bc3df623de8761d1e719ae697d4 blob - 6a64f1edca2e533d797c2fc7ebd6e8d738023fa4 blob + 1face8ad5d73a913a43cc2f7586b6c1922ea5ec4 --- lib/got_lib_privsep.h +++ lib/got_lib_privsep.h @@ -458,7 +458,7 @@ struct got_imsg_send_upload_progress { /* Structure for GOT_IMSG_SEND_REF data. */ struct got_imsg_send_ref { - uint8_t id[SHA1_DIGEST_LENGTH]; + struct got_object_id id; int delete; size_t name_len; /* Followed by name_len data bytes. */ blob - 16a24da99f408f5487194b9f4ff88b84b5add165 blob + 486273f87d27a716cd1cadfc39e0d0f612116981 --- lib/privsep.c +++ lib/privsep.c @@ -816,7 +816,7 @@ send_send_ref(const char *name, size_t name_len, struc return got_error_from_errno("imsg_create SEND_REF"); /* Keep in sync with struct got_imsg_send_ref! */ - if (imsg_add(wbuf, id->sha1, sizeof(id->sha1)) == -1) + if (imsg_add(wbuf, id, sizeof(*id)) == -1) return got_error_from_errno("imsg_add SEND_REF"); if (imsg_add(wbuf, &delete, sizeof(delete)) == -1) return got_error_from_errno("imsg_add SEND_REF"); blob - 40b31c00d9ba7fd602c0df52657c1340c932af57 blob + fc0bd390dcef939a8f1e78602a5314b33713e0fd --- libexec/got-send-pack/got-send-pack.c +++ libexec/got-send-pack/got-send-pack.c @@ -704,7 +704,7 @@ main(int argc, char **argv) err = got_error_from_errno("malloc"); goto done; } - memcpy(id->sha1, href.id, SHA1_DIGEST_LENGTH); + memcpy(id, &href.id, sizeof(*id)); if (href.delete) err = got_pathlist_append(&delete_refs, refname, id); else