Commit f0c85ff8 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

usp10: Correct some reading buffer overruns when parsing indic syllables.

Found with help from Dan Kegel and Valgrind.
parent 8836da81
......@@ -86,7 +86,7 @@ static INT consonant_header(LPCWSTR input, INT cChar, INT start, INT next,
next++;
if ((next < cChar) && lex(input[next]) == lex_Nukta)
next++;
if (lex(input[next])==lex_Halant)
if ((next < cChar) && lex(input[next])==lex_Halant)
{
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]) ))
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;
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]) ))
next+=2;
if (is_matra( lex(input[next]) ))
if ((next < cChar) && is_matra( lex(input[next]) ))
{
while((next < cChar) && is_matra( lex(input[next]) ))
next++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment