Skip to content

Conversation

@EternalDreamer01
Copy link

Attempt to fix issue #5405

@ffontaine
Copy link
Contributor

Adding r"(3\.\d+\.\d+)" for sqlite will raise many false positives (e.g. any file containing 3.0.0 will be detected as sqlite)

@ffontaine
Copy link
Contributor

Same issue with libxml2 and "GITv([0-9]+\.[0-9]+\.[0-9]+)" which could raise false positives.
I would advocate to make a regex with XML_ENTITY_REF_NODE.

@EternalDreamer01
Copy link
Author

EternalDreamer01 commented Dec 4, 2025

I see, I wasn't sure of how it worked.
XML_ENTITY_REF_NODE is on the line below, and I don't know how it could be managed in your project

@ffontaine
Copy link
Contributor

You can manage it by adding a multi-line pattern which contains \r\n such as ([0-9]+\.[0-9]+\.[0-9]+)[a-z0-9>\-\r\n]*XML_ENTITY_REF_NODE.
I would also recommend to split your PR in two different PRs: one for libxml2 and another for sqlite as libxml2 is probably easier to handle.
You must also update /test/test_data/xml2.py instead of adding libraries in lib directory.
Finally, dummy_vex_output and test.sbom must be removed as those files are unrelated to the PR.
You'll find useful information here:

@EternalDreamer01
Copy link
Author

Alright I'm going to split my PR, first for libxml2.
However, there's no precompiled libxml2 to my knowledge, it has to be compiled from source, or pulled from an Android device/emulator.
So how can we proceed ?
Thank you !

@ffontaine
Copy link
Contributor

If no package can be downloaded, you can just copy/paste the pattern you want to detect in a new entry under mapping_test_data :

mapping_test_data = [
    ...
    {
        "product": "libxml2",
        "version": "2.9.9",
        "version_strings": ["20909-GITv2.9.9-rc2-2-g7c4949afa\n-->\nXML_ENTITY_REF_NODE"],
    }
]

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