Skip to content

check target bounds in phonet '^^' rule handling#690

Open
arshsmith1 wants to merge 1 commit into
GNUAspell:masterfrom
arshsmith1:phonet-target-overflow
Open

check target bounds in phonet '^^' rule handling#690
arshsmith1 wants to merge 1 commit into
GNUAspell:masterfrom
arshsmith1:phonet-target-overflow

Conversation

@arshsmith1

Copy link
Copy Markdown

phonet() bounds every write to target with j < len except the one in the '^^' restart branch. Because that branch resumes at i = 0 on a word that only loses one character per pass, a rule set with A^^ mapping to XYZ keeps appending after j has already reached len, and on the eight character word AAAAAAAA ASan reports a heap write past the end of the len + 1 buffer that the to_soundslike callers hand in. Adding the same guard the two neighbouring target writes already use keeps the result truncated at len.

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