Skip to content

util: do not parse truncated input on append failure - #185

Open
prownd wants to merge 1 commit into
rsyslog:mainfrom
prownd:util-do-not-parse-truncated-input-on-append-failure-s01
Open

prownd wants to merge 1 commit into
rsyslog:mainfrom
prownd:util-do-not-parse-truncated-input-on-append-failure-s01

Conversation

@prownd

@prownd prownd commented Sep 15, 2026

Copy link
Copy Markdown

fjson_object_from_fd() ignored the return value of printbuf_memappend(). If an append failed (e.g. out of memory) it went on to parse whatever had been accumulated so far, silently returning an object built from truncated input. Check the result and fail instead.


Summary by cubic

Fixes fjson_object_from_fd() so it no longer parses truncated input when printbuf_memappend() fails. Previously the return value was ignored, so on append failure (e.g., out of memory) it silently returned an object built from incomplete data; now it logs an error, frees the buffer, and returns NULL.

Written for commit eae5c6a. Summary will update on new commits.

Review in cubic

fjson_object_from_fd() ignored the return value of printbuf_memappend().
If an append failed (e.g. out of memory) it went on to parse whatever had
been accumulated so far, silently returning an object built from truncated
input. Check the result and fail instead.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

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.

1 participant