Commit 194b7cd5 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

comctl32: Fix invalid usage of CompareString in StrRStr functions.

parent 13216442
......@@ -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))
{
......
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