Repository navigation
Fix potential OoB in describe_scripted_caller - #843
Merged
Merged
Conversation
The fixed stack size in combination with `strncpy`, which does not null-terminate if the string is >= buffer length, CStr::from_ptr would read beyond the array bounds (until null is encountered). Fix this by using the existing fill string callback, to write directly into a rust allocated String. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Avoid UB on non-utf8 inputs. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
sagudev
approved these changes
Nov 1, 2026
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
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.
The fixed stack size in combination with
strncpy, which does not null-terminate if the string is >= buffer length,CStr::from_ptrwould read beyond the array bounds (until null is encountered). Fix this by using the existing fill string callback, to write directly into a rust allocated String.Addtionally also harden the fill string callback, and convert to utf-8 lossy, instead of having UB if the SM side calls the callback with non-utf8 input.
Testing: No tests were added
Fixes: #839