Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spot] Fix abort trap with NotoNastaliqUrdu #520

Merged
merged 8 commits into from
Aug 1, 2018
Merged

Conversation

readroberts
Copy link
Contributor

Fixes #465 [spot] Abort trap with NotoNastaliqUrdu

Fix text buffer overrun by writing it out whenever the buffer gets close to its limit.
Add test.

Add test to validate failure of spot in this test case.

When dumping a format 2 PosRule from a lookup Type 7, spot was writing past the end of a fixed length string buffer and destroying the stack.
Fix test to validate failure of spot in this test case - did not fail with crash because spot reported that output file was bad in Appveyor run.
Fix test to validate failure of spot in this test case - on Windows, needed to overrun by the buffer by more than 1K.
Fix text buffer overrun by writing it out whenever the buffer gets close to its limit,

Change test to validate success of spot in this test case.
def test_bug465():
""" Fix bug where a fixed length string buffer was overrun. The test
font was built by building an otf from
makeotf/data/innput/t1pfa.pfa, dumping this to ttx, and then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inaccurate path, which also includes a typo

hand-editing the ttx file to have empty charstrings, and a
ContextPos lookup type 7, format 2. Hand-editing the ttx was needed
as makeotf does not build this lookup type, nor this post rule
format. This test validates that the current spot code fails with
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this description is now outdated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in most recent commit.

Fix test to validate success of spot in this test case: correct typo, and that the tests requires success rather than failure.
if ((psIndex + strlen(name2) + 10) >= kProofBufferLen)
{
if (level == 7)
fprintf(OUTPUTBUFF, "\n %s", proofString);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change line 3581 to use spaces instead of a tab character in the output string.
(Line 3592, which is otherwise identical, uses spaces instead of a tab in the output string.)

Fix spacing in message string. GPOS.c
Updated expected output file to match previous
six spacing in message string. GPOS.c.
miguelsousa
miguelsousa previously approved these changes Aug 1, 2018
@miguelsousa miguelsousa merged commit 38a95b8 into develop Aug 1, 2018
@miguelsousa miguelsousa deleted the fix-bug465 branch August 1, 2018 23:59
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.

[spot] Abort trap with NotoNastaliqUrdu
3 participants