Handle SStream overflow by truncating appends#2909
Closed
trufae wants to merge 4 commits into
Closed
Conversation
Rot127
requested changes
May 1, 2026
Collaborator
Rot127
left a comment
There was a problem hiding this comment.
For sure way cleaner! Thanks.
One nitpick, otherwise lgtm.
Co-authored-by: Rot127 <45763064+Rot127@users.noreply.github.com>
Rot127
requested changes
May 3, 2026
| if (remaining == 0) { | ||
| return; | ||
| } | ||
| CS_ASSERT_RET(remaining > 0) |
Collaborator
There was a problem hiding this comment.
Missing ;.
(Can make a suggestion. Github is broken again for whatever reason.)
trufae
commented
May 3, 2026
Rot127
reviewed
May 4, 2026
Collaborator
|
@trufae Can you please run clang-format real quick. Otherwise lgtm and I would merge. |
Rot127
approved these changes
May 11, 2026
2 tasks
Collaborator
|
Cherry-picked your changes here: #2921 Thanks a lot! |
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.
Your checklist for this pull request
Detailed description
This enforces null terminated buffer and behaves better as it truncates properly in case there's not enough space. im fine for not merging this but i prefer a consistent behaviour than an assert with a macro. but thats just up to decide the behaviour users expects from this corner case
...
Test plan
there's a test attached
...
Closing issues
...