Skip to content

Backport 2361 - #2423

Merged
jan-cerny merged 3 commits into
OpenSCAP:maint-1.3from
Mab879:2361_maint_1_3
Oct 5, 2026
Merged

jan-cerny merged 3 commits into
OpenSCAP:maint-1.3from
Mab879:2361_maint_1_3

Conversation

@Mab879

@Mab879 Mab879 commented Oct 4, 2026

Copy link
Copy Markdown
Member

Backport #2361

Missing XML attributes/namespaces/text make libxml return NULL, which was
then passed to strcmp/atoi/atof or dereferenced. Guard these and make the
shared string helpers NULL-tolerant.

- common/util.h: oscap_str_startswith()/oscap_str_endswith() return false on
  a NULL string (matching oscap_strcmp/oscap_streq).
- OVAL: guard the optional `version` attribute before atoi() in oval_state,
  oval_definition, oval_object, oval_variable, oval_resultDefinition; guard
  the `reported` attribute (oval_directives); guard a NULL frame from a
  duplicate variable id (oval_varModel).
- XCCDF: NULL-safe atof() for empty lower/upper-bound and score elements
  (value.c, result.c); reject a NULL <TestResult> (benchmark.c); skip a
  <platform> with no @idref before strlen() (item.c); reject a NULL profile
  in tailoring (tailoring.c).
- DS: NULL-safe id comparisons in sds_index / rds; reject a component with no
  id as a hash key (ds_rds_session.c).
@Mab879 Mab879 added this to the 1.3.15 milestone Oct 4, 2026
@sonarqubecloud

sonarqubecloud Bot commented Oct 4, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@Mab879 Mab879 changed the title 2361 maint 1 3 Backport 2361 Oct 4, 2026

@jan-cerny jan-cerny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have confirmed that the PR is the same as the linked PR and correctly backports the linked PR to the target branch.

@jan-cerny
jan-cerny merged commit 888c69f into OpenSCAP:maint-1.3 Oct 5, 2026
10 of 11 checks passed
@Mab879
Mab879 deleted the 2361_maint_1_3 branch October 5, 2026 16:26
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.

3 participants