Skip to content

Fix potential secret value crash in font string width checks#19

Open
Amadeus- wants to merge 1 commit intoResike:mainfrom
Amadeus-:WrapFontStringSecretValuesFix
Open

Fix potential secret value crash in font string width checks#19
Amadeus- wants to merge 1 commit intoResike:mainfrom
Amadeus-:WrapFontStringSecretValuesFix

Conversation

@Amadeus-
Copy link
Copy Markdown

WrapFontString and CheckFontStringLength both loop comparing GetStringWidth() against a max width. In Midnight, GetStringWidth() can return a secret value in tainted execution contexts, and the > comparison throws an error.

Added the same pcall + issecretvalue guard pattern that's already used in GUI_Main.lua's FixRow function — wrap the call in pcall, check the result is a real number and not secret, bail out of the loop otherwise.

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.

1 participant