-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix length when getting property from host #123774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Tagging subscribers to this area: @agocke, @jeffschwMSFT, @elinor-fung |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Fixes incorrect SString length handling when reading runtime properties from the host by aligning buffer open/close semantics with the host contract’s “length includes null terminator” behavior.
Changes:
- Adjusts
OpenUTF8Buffersizing to account forSString’s implicit null terminator space. - Uses
CloseBuffer(finalCount)with the actual number of bytes written (excluding the null terminator). - Adds tighter failure handling for invalid/failed host property reads.
3795252 to
b5074f1
Compare
AaronRobinsonMSFT
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit. Other than that, nice job tracking this mess down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
When getting a property from the host, we'd end up with a string length that was greater than the actual property length. Close the buffer with the actual length written.
cc @dotnet/appmodel @AaronRobinsonMSFT