commit - 6fdbf7b0468582179f8092cb136a1ac50cadc428
commit + 80d5fc1f55fd4de8222e9d0f56da2695260a07a8
blob - 3eb4935453e45577aff7e16df110aee173bedd1d
blob + e6d36a8f2cde149b9fbe82ac1226b865061e1ce0
--- lib/reference.c
+++ lib/reference.c
if (*ref == NULL)
return got_error_from_errno();
- memcpy(&(*ref)->ref.ref.sha1, id->sha1, SHA1_DIGEST_LENGTH);
+ memcpy((*ref)->ref.ref.sha1, id->sha1, sizeof((*ref)->ref.ref.sha1));
(*ref)->flags = flags;
(*ref)->ref.ref.name = strdup(name);
if ((*ref)->ref.ref.name == NULL) {
return NULL;
}
memcpy(ret->ref.ref.sha1, ref->ref.ref.sha1,
- SHA1_DIGEST_LENGTH);
+ sizeof(ret->ref.ref.sha1));
}
return ret;
*id = calloc(1, sizeof(**id));
if (*id == NULL)
return got_error_from_errno();
- memcpy((*id)->sha1, ref->ref.ref.sha1, SHA1_DIGEST_LENGTH);
+ memcpy((*id)->sha1, ref->ref.ref.sha1, sizeof((*id)->sha1));
return NULL;
}