Skip to content

Fixed crash on JSON null values in host_specific.json - #6507

Open
djbclark wants to merge 1 commit into
cfengine:masterfrom
djbclark:fix/cmdb-null-value-crash-r4
Open

djbclark wants to merge 1 commit into
cfengine:masterfrom
djbclark:fix/cmdb-null-value-crash-r4

Conversation

@djbclark

Copy link
Copy Markdown
Contributor

A null variable value in host_specific.json crashed cf-agent and cf-promises. Reject it and keep loading valid entries.

Behavior chosen: a scalar null is logged as an error and skipped, the rest of the file still loads, and nulls inside lists and data keep their current meaning. If you would prefer it to be fatal, an empty string, or to undefine the variable, I can change it.

Debug test: fails before, passes after; 12/12 CMDB tests pass. AI-assisted.

Details: issue, tests and reviews.

Reject null scalar values and keep loading valid entries.

Changelog: Title
Ticket: none
Signed-off-by: Daniel JB Clark <djbclark@gmail.com>
@cf-bottom

Copy link
Copy Markdown

Thanks for submitting a pull request! Maybe @craigcomstock can review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants