usp10: Fix invalid read.

This commit is contained in:
Thomas Faller 2015-09-03 11:50:36 +02:00 committed by Alexandre Julliard
parent 80c3fca056
commit f1334dbb8d
1 changed files with 2 additions and 1 deletions

View File

@ -1477,7 +1477,8 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
}
}
while ((!levels || (levels && levels[cnt+1] == levels[0])) && (pwcInChars[cnt] == Numeric_space) && cnt < cInChars)
while ((!levels || (levels && cnt+1 < cInChars && levels[cnt+1] == levels[0]))
&& (cnt < cInChars && pwcInChars[cnt] == Numeric_space))
cnt++;
if (cnt == cInChars) /* All Spaces */