From: Omar Polo Subject: got_object_open: copy the whole id To: gameoftrees@openbsd.org Date: Sat, 04 Feb 2023 18:07:18 +0100 as per subject; for now the struct got_object_id is only a wrapper around the sha1 array, in the future things might change ;-) diff /home/op/w/got commit - 3c23f6cdb61cc63d6fd9ecbcc015cd1347793eb1 path + /home/op/w/got blob - f80d86a8686711ff5888dd6847e0d84b98bc0672 file + lib/object_open_privsep.c --- lib/object_open_privsep.c +++ lib/object_open_privsep.c @@ -446,7 +446,7 @@ got_object_open(struct got_object **obj, struct got_re if (err) return err; - memcpy((*obj)->id.sha1, id->sha1, SHA1_DIGEST_LENGTH); + memcpy(&(*obj)->id, id, sizeof(*id)); (*obj)->refcnt++; return got_repo_cache_object(repo, id, *obj);