Browse Source

Avoid buffer underflow

master
Samuel Thibault 2 years ago
parent
commit
60767a41c0
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/libespeak-ng/dictionary.c

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

// look for multibyte characters to increase the number of bytes to remove // look for multibyte characters to increase the number of bytes to remove
for (len_ending = i = (end_type & 0x3f); i > 0; i--) { // num.of characters of the suffix for (len_ending = i = (end_type & 0x3f); i > 0; i--) { // num.of characters of the suffix
word_end--; word_end--;
while ((*word_end & 0xc0) == 0x80) {
while (word_end >= word && (*word_end & 0xc0) == 0x80) {
word_end--; // for multibyte characters word_end--; // for multibyte characters
len_ending++; len_ending++;
} }

Loading…
Cancel
Save