Rebase against 5c756468656afc9207c0f51f774bbc29267e1469.

This commit is contained in:
Alistair Leslie-Hughes
2021-06-22 09:06:59 +10:00
parent fd5866f6f1
commit 9c8608eea6
5 changed files with 30 additions and 42 deletions

View File

@@ -1,4 +1,4 @@
From 21abf2eb3cab9a3dea048171eccd775949cfd548 Mon Sep 17 00:00:00 2001
From 8c7a7c6ba3e1a7752bd0bb5d58e01cc7c3475c88 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Fri, 18 Nov 2016 22:31:29 +0800
Subject: [PATCH] uxtheme: Protect CloseThemeData() from invalid input.
@@ -14,7 +14,7 @@ Testcase by Michael Müller <michael@fds-team.de>.
3 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c
index cd7677e5783..a0ec290eb40 100644
index ed22d923250..21106a5f8e0 100644
--- a/dlls/uxtheme/msstyles.c
+++ b/dlls/uxtheme/msstyles.c
@@ -32,6 +32,7 @@
@@ -25,7 +25,7 @@ index cd7677e5783..a0ec290eb40 100644
#include "wine/debug.h"
#include "wine/heap.h"
@@ -50,6 +51,8 @@ extern int alphaBlendMode;
@@ -48,6 +49,8 @@ static HRESULT MSSTYLES_GetFont (LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPC
#define MSSTYLES_VERSION 0x0003
@@ -34,7 +34,7 @@ index cd7677e5783..a0ec290eb40 100644
static PTHEME_FILE tfActiveTheme;
/***********************************************************************/
@@ -205,6 +208,7 @@ void MSSTYLES_CloseThemeFile(PTHEME_FILE tf)
@@ -203,6 +206,7 @@ void MSSTYLES_CloseThemeFile(PTHEME_FILE tf)
pcls->partstate = ps->next;
heap_free(ps);
}
@@ -42,7 +42,7 @@ index cd7677e5783..a0ec290eb40 100644
heap_free(pcls);
}
}
@@ -433,6 +437,7 @@ static PTHEME_CLASS MSSTYLES_AddClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWST
@@ -431,6 +435,7 @@ static PTHEME_CLASS MSSTYLES_AddClass(PTHEME_FILE tf, LPCWSTR pszAppName, LPCWST
if(cur) return cur;
cur = heap_alloc(sizeof(*cur));
@@ -50,7 +50,7 @@ index cd7677e5783..a0ec290eb40 100644
cur->hTheme = tf->hTheme;
lstrcpyW(cur->szAppName, pszAppName);
lstrcpyW(cur->szClassName, pszClassName);
@@ -1024,6 +1029,23 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList)
@@ -1022,6 +1027,23 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList)
*/
HRESULT MSSTYLES_CloseThemeClass(PTHEME_CLASS tc)
{
@@ -96,12 +96,12 @@ index 0b7e1ab35cc..ba10ac82b82 100644
} THEME_IMAGE, *PTHEME_IMAGE;
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index 5b6c91dc481..83b8f2ba040 100644
index 869dbe2cdc9..f5097012a2d 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -189,6 +189,10 @@ static void test_OpenThemeData(void)
"Expected GLE() to be E_PROP_ID_UNSUPPORTED, got 0x%08x\n",
GetLastError());
@@ -195,6 +195,10 @@ static void test_OpenThemeData(void)
ok( GetLastError() == E_PROP_ID_UNSUPPORTED, "Expected 0x%08x, got 0x%08x\n",
E_PROP_ID_UNSUPPORTED, GetLastError() );
+ /* Close invalid handle */
+ hRes = CloseThemeData((HTHEME)0xdeadbeef);
@@ -111,5 +111,5 @@ index 5b6c91dc481..83b8f2ba040 100644
{
SetLastError(0xdeadbeef);
--
2.28.0
2.30.2