Skip to content

fix: potential UAF in SysFont#15

Merged
Electr0Gunner merged 1 commit into
LawnProject:mainfrom
Pistonight:sysfont_uaf
Jun 22, 2026
Merged

fix: potential UAF in SysFont#15
Electr0Gunner merged 1 commit into
LawnProject:mainfrom
Pistonight:sysfont_uaf

Conversation

@Pistonight

Copy link
Copy Markdown
Contributor

When a SysFont is duplicated (via copy constructor or Duplicate()), the clone gets the same underlying TrueTypeData pointer. When one copy of the SysFont is destroyed, it frees the TrueTypeData and destroys the underlying FT_Face.
DrawString still access the FT_Face afterwards.

It would be even better to make TrueTypeData the RAII container for FT_Face but that's too big of a change right now

@Electr0Gunner Electr0Gunner merged commit 68dc22c into LawnProject:main Jun 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants