Skip to content

Validate PGF parser bounds - #21966

Open
acts-1631 wants to merge 1 commit into
hrydgard:masterfrom
acts-1631:fix/pgf-parser-bounds
Open

Validate PGF parser bounds#21966
acts-1631 wants to merge 1 commit into
hrydgard:masterfrom
acts-1631:fix/pgf-parser-bounds

Conversation

@acts-1631

Copy link
Copy Markdown
Contributor

PGF parsing validated only the base header before reading revision-specific data and table-driven bitstreams. A truncated revision-3 font supplied by PSP content could read past the font buffer and crash PPSSPP.

Track remaining input while parsing headers and tables, and validate glyph bitstream reads before dereferencing them.

Track remaining input while parsing PGF headers and tables, and
validate all glyph bitstream reads. This rejects truncated user fonts
before they can access memory outside the supplied buffer.
@hrydgard hrydgard added this to the v1.21 milestone Jul 24, 2026
@Nemoumbra

Copy link
Copy Markdown
Collaborator

Damn, this looks almost completely rewritten 😭
By the way, do you have an actual file that can be used to reproduce the out-of-bounds access?

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.

3 participants