fix(jsonwrap): handle potential null keys - #22326
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Prevents a reported SIGSEGV in the JSON wrapper summary-dimensions path by hardening key selection and handling dictionary insertion failures.
Changes:
- Falls back from an empty/null metric name to the metric id when selecting the dictionary key.
- Skips processing when
dictionary_set()fails (e.g., OOM) to avoid dereferencing a null entry.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
thiagoftsm
left a comment
There was a problem hiding this comment.
No issues found after more or less one hour running. LGTM!
* fix(jsonwrap): handle potential null keys and dictionary set failures * address comments * fix(jsonwrap): Add dev mode error message logging (cherry picked from commit 645355e)



Summary
Summary by cubic
Fixes a crash in the JSON summary dimensions formatter by falling back to metric ID when the name is missing and skipping entries with no valid key. Adds dev-mode error logging for visibility and prevents SIGSEGV in v2 JSON wrapping.
rrdmetric_acquired_id(rma)whenrrdmetric_acquired_name(rma)is null or empty.query_target_summary_dimensions_v12.Written for commit 2ae137e. Summary will update on new commits. Review in cubic