Fix segfaults due to parameter size mismatch#48
Open
chrstphrchvz wants to merge 3 commits intoeserte:masterfrom
Open
Fix segfaults due to parameter size mismatch#48chrstphrchvz wants to merge 3 commits intoeserte:masterfrom
chrstphrchvz wants to merge 3 commits intoeserte:masterfrom
Conversation
Contributor
Author
|
I would consider backporting https://core.tcl-lang.org/tk/info/0d9c0d50f9 (tcltk/tk@ca38684090) instead to fix many additional instances of this issue. |
dff2e5a to
813e6c7
Compare
Contributor
Author
|
I changed my mind about backporting the entire upstream change; it shows only two more instances where |
Remove unnecessary casts to (int *) As done upstream: https://core.tcl-lang.org/tk/info/0d9c0d50f9
chrstphrchvz
commented
Dec 11, 2025
| TextItem *textPtr = (TextItem *) itemPtr; | ||
| size_t length; | ||
| int c; | ||
| int c, length; |
Contributor
Author
There was a problem hiding this comment.
Alternatives discussed elsewhere, e.g. #106 (comment) : keep using size_t length, and either pass NULL to Tcl_GetStringFromObj() or use Tcl_GetString() instead. Otherwise, no point in using strlen() after Tcl_GetStringFromObj().
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.
Changes from @khwilliamson: https://rt.cpan.org/Ticket/Display.html?id=128955