diff --git a/README.md b/README.md index 20f0401c..d99cbac4 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,12 @@ Wine. All those differences are also documented on the Included bug fixes and improvements =================================== -**Bugfixes and features included in the next upcoming release [12]:** +**Bugfixes and features included in the next upcoming release [13]:** * Add stub for D3DXComputeTangentFrameEx ([Wine Bug #31984](https://bugs.winehq.org/show_bug.cgi?id=31984)) * Add stub for D3DXIntersect * Ensure X11 input events are handled even without explicit message loop ([Wine Bug #8854](https://bugs.winehq.org/show_bug.cgi?id=8854)) +* Fix access violation when calling GetStringTypeW with NULL src. ([Wine Bug #37759](https://bugs.winehq.org/show_bug.cgi?id=37759)) * Fix handling of subdirectory in FtpFindFirstFile ([Wine Bug #16526](https://bugs.winehq.org/show_bug.cgi?id=16526)) * GetMonitorInfo returns the same name for all monitors ([Wine Bug #37709](https://bugs.winehq.org/show_bug.cgi?id=37709)) * IOCTL_DVD_READ_STRUCTURE expects the wrong size of output buffer for some requests ([Wine Bug #37767](https://bugs.winehq.org/show_bug.cgi?id=37767)) diff --git a/debian/changelog b/debian/changelog index 619e01a0..d366cb81 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,7 @@ wine-staging (1.7.34) UNRELEASED; urgency=low * Added patch to fix invalid usage of RegOpenKeyExW in msdmo. * Added patch to add support for named pipe message mode. * Added patch to avoid calling IDirect3DDevice7_DrawIndexedPrimitive if there is no primitive. + * Added patch to fix access violation when calling GetStringTypeW with NULL src. * Removed patch to implement combase HSTRING objects (accepted upstream). * Removed patch to add fake ProductId to registry (accepted upstream). * Removed patch to implement stubs for MFStartup and MFShutdown (accepted upstream). diff --git a/patches/Makefile b/patches/Makefile index fd8fd67a..563c1b8b 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -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: diff --git a/patches/kernel32-GetStringTypeW/0001-kernel32-Allow-empty-source-in-GetStringTypeW.patch b/patches/kernel32-GetStringTypeW/0001-kernel32-Allow-empty-source-in-GetStringTypeW.patch new file mode 100644 index 00000000..a685fff2 --- /dev/null +++ b/patches/kernel32-GetStringTypeW/0001-kernel32-Allow-empty-source-in-GetStringTypeW.patch @@ -0,0 +1,57 @@ +From 62e504c9dcad87ffd419b5bb157c88342934ff61 Mon Sep 17 00:00:00 2001 +From: Christian Faure +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 + diff --git a/patches/kernel32-GetStringTypeW/definition b/patches/kernel32-GetStringTypeW/definition new file mode 100644 index 00000000..22b3e865 --- /dev/null +++ b/patches/kernel32-GetStringTypeW/definition @@ -0,0 +1 @@ +Fixes: [37759] Fix access violation when calling GetStringTypeW with NULL src.