Browse Source

MatchRule: Avoid unbound loop reading with utf8_in (#2077)

master
Samuel Thibault 5 months ago
parent
commit
a5dc42e07a
No account linked to committer's email address
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/libespeak-ng/dictionary.c

+ 2
- 2
src/libespeak-ng/dictionary.c View File

@@ -1757,7 +1757,7 @@ static void MatchRule(Translator *tr, char *word[], char *word_start, int group_
syllable_count += 1; // number of syllables to match
}
vowel = 0;
while (letter_w != RULE_SPACE) {
while (letter_w != RULE_SPACE && letter_w != 0) {
if ((vowel == 0) && IsLetter(tr, letter_w, LETTERGP_VOWEL2)) {
// this is counting vowels which are separated by non-vowel letters
vowel_count++;
@@ -1774,7 +1774,7 @@ static void MatchRule(Translator *tr, char *word[], char *word_start, int group_
case RULE_NOVOWELS:
{
char *p = post_ptr + letter_xbytes;
while (letter_w != RULE_SPACE) {
while (letter_w != RULE_SPACE && letter_w != 0) {
if (IsLetter(tr, letter_w, LETTERGP_VOWEL2)) {
failed = 1;
break;

Loading…
Cancel
Save