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

syllable_count += 1; // number of syllables to match syllable_count += 1; // number of syllables to match
} }
vowel = 0; vowel = 0;
while (letter_w != RULE_SPACE) {
while (letter_w != RULE_SPACE && letter_w != 0) {
if ((vowel == 0) && IsLetter(tr, letter_w, LETTERGP_VOWEL2)) { if ((vowel == 0) && IsLetter(tr, letter_w, LETTERGP_VOWEL2)) {
// this is counting vowels which are separated by non-vowel letters // this is counting vowels which are separated by non-vowel letters
vowel_count++; vowel_count++;
case RULE_NOVOWELS: case RULE_NOVOWELS:
{ {
char *p = post_ptr + letter_xbytes; 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)) { if (IsLetter(tr, letter_w, LETTERGP_VOWEL2)) {
failed = 1; failed = 1;
break; break;

Loading…
Cancel
Save