Repository navigation
Fix Godeps parsing crashes on unknown fields, null Deps, and invalid import paths (fixes #5569) - #5570
Open
patelshivani2283-lab wants to merge 1 commit into
Conversation
…import paths (fixes aboutcode-org#5569) - Ignore unknown top-level and dependency fields in Godep.loads and parse_deps - Safely handle null Deps without TypeError crashes - Safely handle non-dict and malformed JSON inputs - Validate and strip dependency import_path before PURL creation to prevent ValueError crashes or pkg:golang/None - Add comprehensive unit tests covering all edge cases - Update CHANGELOG.rst and AUTHORS.rst Signed-off-by: Shivani Patel <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #5569
Resolves multiple crashes when parsing Go
Godeps.jsonfiles:Godep.loadswithout crashing withTypeError: attribute name must be string, not 'NoneType'.Godep.parse_depswithout crashing withKeyError: '<key>'.nullinDepswithout raisingTypeError: 'NoneType' object is not iterable.import_pathin dependency entries before constructing PURLs to preventValueError: purl is missing the required name componentor creating invalidpkg:golang/Nonedependencies.CHANGELOG.rstandAUTHORS.rst.Verification
Ran all
test_godeps.pytests with pytest: