CFE-3105: Made format collect data container#6223
Draft
victormlg wants to merge 4 commits into
Draft
Conversation
bf0432b to
9667796
Compare
| { | ||
| Writer *w = StringWriter(); | ||
| JsonWriteCompact(w, (JsonElement*) data->val.item); | ||
| BufferAppendF(buf, format_rewrite, StringWriterData(w)); |
4cbd7be to
17788db
Compare
An insert_lines promise using select_region with select_end_match_eof cannot select the region of the final section when that section header is the last line of the file. The region is empty and sits at the end of the file, SelectRegion() rejects it, and the insertion fails with "could not select an edit region". This test fails today and will pass once SelectRegion() honors select_end_match_eof for an empty region at end of file. Ticket: CFE-2663 Changelog: None Signed-off-by: Nick Anderson <nick@cmdln.org>
The read loop never touched the output buffer when the command produced no output: it hit EOF on the first iteration and returned success, leaving the buffer exactly as the caller allocated it. A caller using malloc() then saw stale heap data as command output — this made cf-agent's container inventory intermittently treat a freed 'docker image inspect' JSON buffer as the 'docker volume ls --quiet' result on Windows. NUL-terminate the buffer up front so callers always get a valid, possibly empty, string. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Ihor Aleksandrychiev <ihor.aleksandrychiev@northern.tech>
Ticket: CFE-3105 Changelog: Title Signed-off-by: Victor Moene <victor.moene@northern.tech>
17788db to
3a40ef1
Compare
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.
No description provided.