Skip to content

bound BMF block walk to buffer end#1643

Open
rootvector2 wants to merge 1 commit into
Moddable-OpenSource:publicfrom
rootvector2:bmf-block-bounds
Open

bound BMF block walk to buffer end#1643
rootvector2 wants to merge 1 commit into
Moddable-OpenSource:publicfrom
rootvector2:bmf-block-bounds

Conversation

@rootvector2

Copy link
Copy Markdown
Contributor

the BMF block walk in xs_parseBMF and CFESetFontData advances bytes by file-controlled block sizes (bytes += 4 + c_read32(bytes), bytes += size - 8) without bounding the cursor against the buffer end, so a crafted block size makes the next c_read* read past the allocation (found with an asan build feeding a truncated font); this bounds every advance and field read against end.

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