Skip to content

fix(swift): guard slice access when pod entry has no version in Podfile.lock parser - #5106

Open
AruneshDwivedi wants to merge 1 commit into
anchore:mainfrom
AruneshDwivedi:fix/swift-podfile-bounds
Open

fix(swift): guard slice access when pod entry has no version in Podfile.lock parser#5106
AruneshDwivedi wants to merge 1 commit into
anchore:mainfrom
AruneshDwivedi:fix/swift-podfile-bounds

Conversation

@AruneshDwivedi

Copy link
Copy Markdown

When parsing Podfile.lock entries, the pod string is split by spaces to extract name and version. A pod specified without a version caused an index-out-of-bounds panic on splits[1]. Added bounds check before accessing the version field.

Used AI to help identify and draft this fix — reviewed and tested before submitting.

…le.lock parser

When parsing Podfile.lock entries, the pod string is split by spaces to extract name and version. A pod specified without a version caused an index-out-of-bounds panic on splits[1]. Added bounds check before accessing the version field.

Signed-off-by: Kushal Dwivedi <arunesh.devops@gmail.com>
@wagoodman

Copy link
Copy Markdown
Contributor

Thanks for the contribution -- can you add unit tests to show this is behaving as you'd expect?

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