Skip to content

fix: skip filling in empty fields in APK metadata#1484

Merged
wagoodman merged 1 commit intoanchore:mainfrom
Nirusu:fix/apk-empty-d-p
Jan 20, 2023
Merged

fix: skip filling in empty fields in APK metadata#1484
wagoodman merged 1 commit intoanchore:mainfrom
Nirusu:fix/apk-empty-d-p

Conversation

@Nirusu
Copy link
Copy Markdown
Contributor

@Nirusu Nirusu commented Jan 19, 2023

Attempt to fix #1483. This should skip empty fields in the definition, leaving the Dependencies and Provides slices empty.
Added a test for it.

The debug log message might be a bit noisy, so not sure whether to keep it? It also lacks the package name when printing. However, since the package name is parsed from another field in the same context, I didn't want to rely on it.

Feedback and suggestions appreciated!

@Nirusu Nirusu force-pushed the fix/apk-empty-d-p branch 7 times, most recently from b5aa735 to 80b773b Compare January 19, 2023 15:56
Copy link
Copy Markdown
Contributor

@kzantow kzantow left a comment

Choose a reason for hiding this comment

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

LGTM -- and I think debug logging here is okay

Signed-off-by: Nils Hanke <nils.hanke@outlook.de>
@wagoodman wagoodman enabled auto-merge (squash) January 20, 2023 13:53
@wagoodman
Copy link
Copy Markdown
Contributor

note: force pushed to rebase on main (fixes the CLI test failure)

@wagoodman wagoodman merged commit 99f55f6 into anchore:main Jan 20, 2023
@wagoodman wagoodman added bug Something isn't working and removed bug Something isn't working labels Jan 20, 2023
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
Signed-off-by: Nils Hanke <nils.hanke@outlook.de>

Signed-off-by: Nils Hanke <nils.hanke@outlook.de>
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.

Syft panics on APK parsing when Dependencies or Provides holds an empty string

3 participants