Support dpkginfo name pattern operations#2354
Open
officialasishkumar wants to merge 2 commits into
Open
Conversation
officialasishkumar
requested review from
Mab879,
jan-cerny and
matusmarhefka
as code owners
May 11, 2026 19:33
|
Mab879
reviewed
Jun 10, 2026
Mab879
left a comment
Member
There was a problem hiding this comment.
Please review findings from SonarCloud and GitHub Advanced Security some seem worth fixing.
|
|
||
| for (i = 0; i < num_items; ++i) { | ||
| for (size_t i = 0; i < dpkginfo_reply_count; ++i) { | ||
| SEXP_t *name = SEXP_string_newf("%s", dpkginfo_replies[i].name); |
Member
There was a problem hiding this comment.
It looks like on the success path this isn't freeed.
Contributor
Author
There was a problem hiding this comment.
Freed the temporary SEXP after item creation in a4cba45.
Enumerate Debian package status entries for dpkginfo_object name matching and filter them through the common OVAL entity comparison helper. This supports equals, not equal, and pattern match operations while preserving exact virtual package lookup through Provides entries. Add an offline dpkginfo probe regression test covering exact, pattern, not equal, and virtual package names. Fixes OpenSCAP#2338.
officialasishkumar
force-pushed
the
fix_2338
branch
from
July 1, 2026 07:46
3f0ca3d to
a4cba45
Compare
|
Mab879
reviewed
Jul 17, 2026
| { | ||
| for (size_t i = 0; i < reply_count; i++) | ||
| dpkginfo_clear_reply(replies + i); | ||
| free(replies); |
Member
There was a problem hiding this comment.
Should we add null guard here as well?
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
dpkginfo_objectnamesFixes #2338.
Testing
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_PYTHON3=OFF -DENABLE_PERL=OFF -DENABLE_DOCS=OFF -DENABLE_OSCAP_UTIL_DOCKER=OFF -DENABLE_OSCAP_UTIL_AS_RPM=OFF ..make -j2 oscapctest -R 'probes/dpkginfo/test_probes_dpkginfo.sh' --output-on-failure\n-bash -n tests/probes/dpkginfo/test_probes_dpkginfo.sh\n-xmllint --noout tests/probes/dpkginfo/test_probes_dpkginfo.xml\n-git diff --check