Skip to content

[6.2][CAS] Fix an off-by-one error in CAS validation #10596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

cachemeifyoucan
Copy link

  • Explanation: Fix a false positive in invalid CAS detection that when the last data stored in CAS just fits inside the DataPool, validation is erroneously think the data stored pass the end of the storage.
  • Scope: Allows CAS validation and recovery correctly so the valid CAS doesn't get throw away
  • Issues: rdar://150386374
  • Original PRs: [CAS] Fix an off-by-one error in CAS validation #10595
  • Risk: Low
  • Testing: UnitTest
  • Reviewers: @benlangmuir

Fix a false positive in invalid CAS detection that when the last data
stored in CAS just fits inside the DataPool, validation is erroneously
think the data stored pass the end of the storage.

The error happens when the size of the data is alignment - 1, as the
null termination padding will make the end of the data matches the end
of the data pool.

rdar://150386374
@cachemeifyoucan cachemeifyoucan requested a review from a team as a code owner April 30, 2025 23:21
@cachemeifyoucan
Copy link
Author

@swift-ci please test

@cachemeifyoucan
Copy link
Author

@swift-ci please test macOS platform

@akyrtzi akyrtzi merged commit f3ac3ff into swiftlang:swift/release/6.2 May 5, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants