Skip to content

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

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
merged 1 commit into from
Apr 30, 2025

Conversation

cachemeifyoucan
Copy link

@cachemeifyoucan cachemeifyoucan commented Apr 30, 2025

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
Copy link
Author

@swift-ci please test llvm

Copy link

@benlangmuir benlangmuir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

@cachemeifyoucan
Copy link
Author

@swift-ci please test llvm

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
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