usp10: Correct some reading buffer overruns when parsing indic syllables.
Found with help from Dan Kegel and Valgrind.
This commit is contained in:
parent
8836da818e
commit
f0c85ff83d
|
@ -86,7 +86,7 @@ static INT consonant_header(LPCWSTR input, INT cChar, INT start, INT next,
|
||||||
next++;
|
next++;
|
||||||
if ((next < cChar) && lex(input[next]) == lex_Nukta)
|
if ((next < cChar) && lex(input[next]) == lex_Nukta)
|
||||||
next++;
|
next++;
|
||||||
if (lex(input[next])==lex_Halant)
|
if ((next < cChar) && lex(input[next])==lex_Halant)
|
||||||
{
|
{
|
||||||
next++;
|
next++;
|
||||||
if((next < cChar) && is_joiner( lex(input[next]) ))
|
if((next < cChar) && is_joiner( lex(input[next]) ))
|
||||||
|
@ -94,7 +94,7 @@ static INT consonant_header(LPCWSTR input, INT cChar, INT start, INT next,
|
||||||
if ((next < cChar) && is_consonant( lex(input[next]) ))
|
if ((next < cChar) && is_consonant( lex(input[next]) ))
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
else if (is_joiner( lex(input[next]) ) && lex(input[next+1])==lex_Halant)
|
else if ((next < cChar) && is_joiner( lex(input[next]) ) && lex(input[next+1])==lex_Halant)
|
||||||
{
|
{
|
||||||
next+=2;
|
next+=2;
|
||||||
if ((next < cChar) && is_consonant( lex(input[next]) ))
|
if ((next < cChar) && is_consonant( lex(input[next]) ))
|
||||||
|
@ -163,7 +163,7 @@ static INT parse_vowel_syllable(LPCWSTR input, INT cChar, INT start,
|
||||||
else if ((next < cChar) && lex(input[next])==lex_ZWJ && is_consonant( lex(input[next+1]) ))
|
else if ((next < cChar) && lex(input[next])==lex_ZWJ && is_consonant( lex(input[next+1]) ))
|
||||||
next+=2;
|
next+=2;
|
||||||
|
|
||||||
if (is_matra( lex(input[next]) ))
|
if ((next < cChar) && is_matra( lex(input[next]) ))
|
||||||
{
|
{
|
||||||
while((next < cChar) && is_matra( lex(input[next]) ))
|
while((next < cChar) && is_matra( lex(input[next]) ))
|
||||||
next++;
|
next++;
|
||||||
|
|
Loading…
Reference in New Issue