Rebase againsts 9ae8b8c00f2cca205fdf4ce76e221778b7dfbea7

This commit is contained in:
Alistair Leslie-Hughes
2018-02-27 09:23:02 +11:00
parent ef8e90cbdc
commit a1ec166849
22 changed files with 539 additions and 686 deletions

View File

@@ -1,20 +1,20 @@
From 56e15c62829a85dead5cd681ada5a69e9374d5e6 Mon Sep 17 00:00:00 2001
From 8a2c1ff72e3802e8e67e21ccb915de17a3c155da Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Fri, 18 Nov 2016 22:31:29 +0800
Subject: uxtheme: Protect CloseThemeData() from invalid input.
Subject: [PATCH] uxtheme: Protect CloseThemeData() from invalid input.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Testcase by Michael Müller <michael@fds-team.de>.
---
dlls/uxtheme/msstyles.c | 22 ++++++++++++++++++++++
dlls/uxtheme/msstyles.c | 21 +++++++++++++++++++++
dlls/uxtheme/msstyles.h | 3 ++-
dlls/uxtheme/tests/system.c | 4 ++++
3 files changed, 28 insertions(+), 1 deletion(-)
3 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c
index e62b95d..1cca4fc 100644
index fe91494..3a25f6d 100644
--- a/dlls/uxtheme/msstyles.c
+++ b/dlls/uxtheme/msstyles.c
@@ -35,6 +35,7 @@
@@ -23,9 +23,9 @@ index e62b95d..1cca4fc 100644
#include "wine/unicode.h"
+#include "wine/exception.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(uxtheme);
@@ -56,6 +57,8 @@ static const WCHAR szThemesIniResource[] = {
@@ -57,6 +58,8 @@ static const WCHAR szThemesIniResource[] = {
't','h','e','m','e','s','_','i','n','i','\0'
};
@@ -34,23 +34,15 @@ index e62b95d..1cca4fc 100644
static PTHEME_FILE tfActiveTheme;
/***********************************************************************/
@@ -219,6 +222,7 @@ void MSSTYLES_CloseThemeFile(PTHEME_FILE tf)
pcls->partstate = ps->next;
HeapFree(GetProcessHeap(), 0, ps);
}
+ pcls->signature = 0;
HeapFree(GetProcessHeap(), 0, pcls);
}
}
@@ -450,6 +454,7 @@ static PTHEME_CLASS MSSTYLES_AddClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWST
@@ -452,6 +455,7 @@ static PTHEME_CLASS MSSTYLES_AddClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWST
if(cur) return cur;
cur = HeapAlloc(GetProcessHeap(), 0, sizeof(THEME_CLASS));
cur = heap_alloc(sizeof(*cur));
+ cur->signature = THEME_CLASS_SIGNATURE;
cur->hTheme = tf->hTheme;
lstrcpyW(cur->szAppName, pszAppName);
lstrcpyW(cur->szClassName, pszClassName);
@@ -1043,6 +1048,23 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList)
@@ -1045,6 +1049,23 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList)
*/
HRESULT MSSTYLES_CloseThemeClass(PTHEME_CLASS tc)
{
@@ -96,10 +88,10 @@ index 0b7e1ab..ba10ac8 100644
} THEME_IMAGE, *PTHEME_IMAGE;
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index d40679d..dba6cc8 100644
index 6989f44..d529279 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -181,6 +181,10 @@ static void test_OpenThemeData(void)
@@ -198,6 +198,10 @@ static void test_OpenThemeData(void)
"Expected GLE() to be E_PROP_ID_UNSUPPORTED, got 0x%08x\n",
GetLastError());
@@ -111,5 +103,5 @@ index d40679d..dba6cc8 100644
{
SetLastError(0xdeadbeef);
--
2.9.0
1.9.1