Skip to content

tests: fix nametabletest NameRecord conversion bounds#106

Open
bgermann wants to merge 1 commit intosilnrsi:masterfrom
bgermann:nametabletest-off-by-one
Open

tests: fix nametabletest NameRecord conversion bounds#106
bgermann wants to merge 1 commit intosilnrsi:masterfrom
bgermann:nametabletest-off-by-one

Conversation

@bgermann
Copy link
Copy Markdown
Contributor

The synthetic name-table builder copied one too many NameRecord entries in toBigEndian().

FontNames already contains name_record[0], while m_records stores only the remaining count-1 records. The loop used count, so for NameTestB (count=8, m_records[7]) it wrote past m_records and corrupted adjacent fields (m_langTagCount/lang tags).

That memory corruption breaks format 1 language-tag lookup and causes fallback behavior.

Fixes: #96

The synthetic name-table builder copied one too many NameRecord entries in
toBigEndian().

FontNames already contains name_record[0], while m_records stores only the
remaining count-1 records. The loop used count, so for NameTestB (count=8,
m_records[7]) it wrote past m_records and corrupted adjacent fields
(m_langTagCount/lang tags).

That memory corruption breaks format 1 language-tag lookup and causes
fallback behavior.

Fixes: silnrsi#96
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.

nametabletest fails on aarch64 with gcc15

1 participant