Fix argument metadata when binding methods#1509
Merged
Merged
Conversation
While there doesn't seem to be any runtime issues, this triggers the address sanitizer in a few ways, depending on what kind of method you're binding.
AThousandShips
approved these changes
Jun 27, 2024
AThousandShips
left a comment
Member
There was a problem hiding this comment.
Makes sense, and matches the code in get_arguments_info_list
|
My extension fails at load because of this bug. Adding the changes here fixed it. Crashes when declaring the |
Collaborator
|
Cherry-picked for 4.2 in PR #1527 |
Collaborator
|
Cherry-picked for 4.1 in PR #1529 |
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.
While there doesn't seem to be any runtime issues, this triggers the address sanitizer in a few ways, depending on what kind of method you're binding.
For a method like this, with a return value
you get a container overflow. It even reaches the Godot side of things, but the bug is caused by
godot-cppall the same: the argument metadata is invalid.Details
A method like this, without a return value and with arguments
causes heap buffer overflow. The return value metadata is invalid.
Details
Looks like this was introduced as is in #896, in commit e24b6b0. A similar method
get_arguments_info_listhad the same issue initially, but was corrected in b6ba0dc, all within the same PR.I can't say if this change has any unexpected side effects, or if it fixes any outstanding issues (quite possible, anything related to arguments can be affected, I guess?), but I can confirm that with it included there are no asan issues in my project anymore.