Skip to content

Commit

Permalink
Merge pull request #3284 from cgwalters/even-more-readlinkat
Browse files Browse the repository at this point in the history
commit/payload-link: Ensure we don't overrun target_checksum size
  • Loading branch information
cgwalters authored Aug 15, 2024
2 parents 0d5e554 + 7683eb5 commit 62284ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libostree/ostree-repo-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ _try_clone_from_payload_link (OstreeRepo *self, OstreeRepo *dest_repo, const cha
loose_path_buf, (unsigned long long)expected_len,
(unsigned long long)size);

snprintf (target_checksum, size, "%.2s%.62s", target_buf + _OSTREE_PAYLOAD_LINK_PREFIX_LEN,
snprintf (target_checksum, sizeof (target_checksum), "%.2s%.62s", target_buf + _OSTREE_PAYLOAD_LINK_PREFIX_LEN,
target_buf + _OSTREE_PAYLOAD_LINK_PREFIX_LEN + 3);

_ostree_loose_path (loose_path_target_buf, target_checksum, OSTREE_OBJECT_TYPE_FILE,
Expand Down

0 comments on commit 62284ea

Please sign in to comment.