From 194b7cd5ae69e8243f3fbd653b31417b45e23252 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Tue, 18 Nov 2014 06:51:00 +0100 Subject: [PATCH] comctl32: Fix invalid usage of CompareString in StrRStr functions. --- dlls/comctl32/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/string.c b/dlls/comctl32/string.c index 8d4150829be..5e28b8fd28d 100644 --- a/dlls/comctl32/string.c +++ b/dlls/comctl32/string.c @@ -683,7 +683,7 @@ LPSTR WINAPI StrRStrIA(LPCSTR lpszStr, LPCSTR lpszEnd, LPCSTR lpszSearch) ch1 = *lpszSearch; iLen = lstrlenA(lpszSearch); - while (lpszStr <= lpszEnd && *lpszStr) + while (lpszStr + iLen <= lpszEnd && *lpszStr) { ch2 = IsDBCSLeadByte(*lpszStr)? *lpszStr << 8 | lpszStr[1] : *lpszStr; if (!COMCTL32_ChrCmpIA(ch1, ch2)) @@ -716,7 +716,7 @@ LPWSTR WINAPI StrRStrIW(LPCWSTR lpszStr, LPCWSTR lpszEnd, LPCWSTR lpszSearch) iLen = strlenW(lpszSearch); - while (lpszStr <= lpszEnd && *lpszStr) + while (lpszStr + iLen <= lpszEnd && *lpszStr) { if (!COMCTL32_ChrCmpIW(*lpszSearch, *lpszStr)) { -- 2.11.4.GIT