Sebastian Lackner : comctl32: Fix invalid usage of CompareString in StrRStr functions.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Nov 18 10:25:19 CST 2014
Module: wine
Branch: master
Commit: 194b7cd5ae69e8243f3fbd653b31417b45e23252
URL: http://source.winehq.org/git/wine.git/?a=commit;h=194b7cd5ae69e8243f3fbd653b31417b45e23252
Author: Sebastian Lackner <sebastian at fds-team.de>
Date: Tue Nov 18 06:51:00 2014 +0100
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 8d41508..5e28b8f 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))
{
More information about the wine-cvs
mailing list