Avoid crashes in Python scripts when objects are accessed in invalid state#5483
Merged
skef merged 23 commits intofontforge:masterfrom Jan 1, 2025
Merged
Avoid crashes in Python scripts when objects are accessed in invalid state#5483skef merged 23 commits intofontforge:masterfrom
skef merged 23 commits intofontforge:masterfrom
Conversation
Contributor
Author
|
The diff in
|
Contributor
Author
|
Ready for review now. |
Contributor
|
Sorry, I want to confirm the reference counting in this code and it's going to take me a while. |
skef
approved these changes
Jan 1, 2025
Contributor
skef
left a comment
There was a problem hiding this comment.
I didn't check this for completeness but what's here looks good to me and barring any bugs that should be easy to fix will make things better. Good work!
| (char *)"a tuple of all anchor points in the glyph", NULL}, | ||
| typedef struct glyph_accessors_ { | ||
| const char* name; | ||
| /* SlpineChar* argument is guaranteed non-NULL */ |
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.
When the font is closed or a specific glyph is deleted in a Python script, there could still be Python objects around which reference the deleted C object. This causes segmentation faults in many scenarios.
We add checks and references which allow to check C object validity before performing operations.
Fixes #4615, fixes #5479.