You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Added patch to fix access violation when calling GetStringTypeW with NULL src.
This commit is contained in:
@@ -53,6 +53,7 @@ PATCHLIST := \
|
||||
iphlpapi-TCP_Table.ok \
|
||||
kernel32-GetFinalPathNameByHandle.ok \
|
||||
kernel32-GetNumaProcessorNode.ok \
|
||||
kernel32-GetStringTypeW.ok \
|
||||
kernel32-GetSystemTimes.ok \
|
||||
kernel32-GetVolumePathName.ok \
|
||||
kernel32-Named_Pipe.ok \
|
||||
@@ -735,6 +736,21 @@ kernel32-GetNumaProcessorNode.ok:
|
||||
echo '+ { "Michael Müller", "kernel32/tests: Add tests for GetNumaProcessorNode.", 1 },'; \
|
||||
) > kernel32-GetNumaProcessorNode.ok
|
||||
|
||||
# Patchset kernel32-GetStringTypeW
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#37759] Fix access violation when calling GetStringTypeW with NULL src.
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/kernel32/locale.c, dlls/kernel32/tests/locale.c
|
||||
# |
|
||||
.INTERMEDIATE: kernel32-GetStringTypeW.ok
|
||||
kernel32-GetStringTypeW.ok:
|
||||
$(call APPLY_FILE,kernel32-GetStringTypeW/0001-kernel32-Allow-empty-source-in-GetStringTypeW.patch)
|
||||
@( \
|
||||
echo '+ { "Christian Faure", "kernel32: Allow empty source in GetStringTypeW.", 1 },'; \
|
||||
) > kernel32-GetStringTypeW.ok
|
||||
|
||||
# Patchset kernel32-GetSystemTimes
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
|
@@ -0,0 +1,57 @@
|
||||
From 62e504c9dcad87ffd419b5bb157c88342934ff61 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Faure <christian.faurebouvard@gmail.com>
|
||||
Date: Tue, 23 Dec 2014 13:13:49 -0300
|
||||
Subject: kernel32: Allow empty source in GetStringTypeW.
|
||||
|
||||
---
|
||||
dlls/kernel32/locale.c | 5 +++++
|
||||
dlls/kernel32/tests/locale.c | 10 ++++++++++
|
||||
2 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
|
||||
index 1460f7a..30f9048 100644
|
||||
--- a/dlls/kernel32/locale.c
|
||||
+++ b/dlls/kernel32/locale.c
|
||||
@@ -2479,6 +2479,11 @@ BOOL WINAPI GetStringTypeW( DWORD type, LPCWSTR src, INT count, LPWORD chartype
|
||||
C2_OTHERNEUTRAL /* LRE, LRO, RLE, RLO, PDF */
|
||||
};
|
||||
|
||||
+ if (!src) /* Abort and return FALSE when src is null */
|
||||
+ {
|
||||
+ SetLastError( ERROR_INVALID_PARAMETER );
|
||||
+ return FALSE;
|
||||
+ }
|
||||
if (count == -1) count = strlenW(src) + 1;
|
||||
switch(type)
|
||||
{
|
||||
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
|
||||
index 65172a7..24b541a 100644
|
||||
--- a/dlls/kernel32/tests/locale.c
|
||||
+++ b/dlls/kernel32/tests/locale.c
|
||||
@@ -3281,6 +3281,7 @@ static void test_GetStringTypeW(void)
|
||||
|
||||
WORD types[20];
|
||||
WCHAR ch;
|
||||
+ BOOL res;
|
||||
int i;
|
||||
|
||||
memset(types,0,sizeof(types));
|
||||
@@ -3338,6 +3339,15 @@ static void test_GetStringTypeW(void)
|
||||
for (i = 0; i < 3; i++)
|
||||
ok(types[i] & C1_SPACE || broken(types[i] == C1_CNTRL) || broken(types[i] == 0), "incorrect types returned for %x -> (%x does not have %x)\n",space_special[i], types[i], C1_SPACE );
|
||||
|
||||
+ for (i = -1; i < 3; i++)
|
||||
+ {
|
||||
+ SetLastError(0xdeadbeef);
|
||||
+ memset(types, 0, sizeof(types));
|
||||
+ res = GetStringTypeW(CT_CTYPE1, NULL, i, types);
|
||||
+ ok(!res, "GetStringTypeW unexpectedly succeeded\n");
|
||||
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error, got %u\n", GetLastError());
|
||||
+ }
|
||||
+
|
||||
/* surrogate pairs */
|
||||
ch = 0xd800;
|
||||
memset(types, 0, sizeof(types));
|
||||
--
|
||||
2.1.3
|
||||
|
1
patches/kernel32-GetStringTypeW/definition
Normal file
1
patches/kernel32-GetStringTypeW/definition
Normal file
@@ -0,0 +1 @@
|
||||
Fixes: [37759] Fix access violation when calling GetStringTypeW with NULL src.
|
Reference in New Issue
Block a user