comctl32: Fix invalid usage of CompareString in StrRStr functions.

This commit is contained in:
Sebastian Lackner 2014-11-18 06:51:00 +01:00 committed by Alexandre Julliard
parent 1321644239
commit 194b7cd5ae
1 changed files with 2 additions and 2 deletions

View File

@ -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))
{