Added patch to workaround bugs in CompareStringW (triggered by Adobe Flash).

This commit is contained in:
Sebastian Lackner
2014-11-15 15:01:16 +01:00
parent 73da458bc5
commit 7e72d7770d
3 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
From afc8ef8ffca3da82a5bb56ee5b496f5d33195c6a Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 15 Nov 2014 14:59:49 +0100
Subject: shlwapi: Workaround for bugs in CompareStringW.
---
dlls/shlwapi/string.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/shlwapi/string.c b/dlls/shlwapi/string.c
index b4b5b8a..72789fc 100644
--- a/dlls/shlwapi/string.c
+++ b/dlls/shlwapi/string.c
@@ -670,6 +670,7 @@ LPSTR WINAPI StrStrIA(LPCSTR lpszStr, LPCSTR lpszSearch)
LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch)
{
int iLen;
+ int jLen;
TRACE("(%s,%s)\n", debugstr_w(lpszStr), debugstr_w(lpszSearch));
@@ -678,11 +679,14 @@ LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch)
iLen = strlenW(lpszSearch);
- while (*lpszStr)
+ /* Workaround for bugs in CompareStringW */
+ jLen = strlenW(lpszStr);
+ while (jLen >= iLen)
{
if (!StrCmpNIW(lpszStr, lpszSearch, iLen))
return (LPWSTR)lpszStr;
lpszStr++;
+ jLen--;
}
return NULL;
}
--
2.1.3