From f1334dbb8d1d6f3678590d38124f1c265bab385a Mon Sep 17 00:00:00 2001 From: Thomas Faller Date: Thu, 3 Sep 2015 11:50:36 +0200 Subject: [PATCH] usp10: Fix invalid read. --- dlls/usp10/usp10.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index fa4dc796a0e..f3fb36917f5 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -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 */