From 632a8a163b8b4bf7a9425f953ad7ab2790411746 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 28 Nov 2015 22:51:22 +0100 Subject: [PATCH] Added patch to skip invalid entries in GetPrivateProfileString16. --- README.md | 3 +- ...ip-invalid-entries-in-GetPrivateProf.patch | 40 +++++++++++++++++++ .../definition | 1 + patches/patchinstall.sh | 19 +++++++++ staging/changelog | 1 + 5 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 patches/krnl386.exe-GetPrivateProfileString/0001-krnl386.exe16-Skip-invalid-entries-in-GetPrivateProf.patch create mode 100644 patches/krnl386.exe-GetPrivateProfileString/definition diff --git a/README.md b/README.md index 58b8a905..c56f9794 100644 --- a/README.md +++ b/README.md @@ -34,11 +34,12 @@ Wine. All those differences are also documented on the Included bug fixes and improvements ----------------------------------- -**Bug fixes and features included in the next upcoming release [3]:** +**Bug fixes and features included in the next upcoming release [4]:** * Add information for delayed end of DST in Europe/Istanbul * Check handle type for HSPFILEQ handles ([Wine Bug #12332](https://bugs.winehq.org/show_bug.cgi?id=12332)) * Fix font loading in Capella ([Wine Bug #12377](https://bugs.winehq.org/show_bug.cgi?id=12377)) +* Skip invalid entries in GetPrivateProfileString16 ([Wine Bug #9919](https://bugs.winehq.org/show_bug.cgi?id=9919)) **Bug fixes and features in Wine Staging 1.8-rc1 [268]:** diff --git a/patches/krnl386.exe-GetPrivateProfileString/0001-krnl386.exe16-Skip-invalid-entries-in-GetPrivateProf.patch b/patches/krnl386.exe-GetPrivateProfileString/0001-krnl386.exe16-Skip-invalid-entries-in-GetPrivateProf.patch new file mode 100644 index 00000000..bc62d6f6 --- /dev/null +++ b/patches/krnl386.exe-GetPrivateProfileString/0001-krnl386.exe16-Skip-invalid-entries-in-GetPrivateProf.patch @@ -0,0 +1,40 @@ +From 29e32e5ad41bbd4a2c19202bea2175cfb11c17b1 Mon Sep 17 00:00:00 2001 +From: Bruno Jesus <00cpxxx@gmail.com> +Date: Sat, 28 Nov 2015 22:47:38 +0100 +Subject: krnl386.exe16: Skip invalid entries in GetPrivateProfileString16. + +--- + dlls/krnl386.exe16/file.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/dlls/krnl386.exe16/file.c b/dlls/krnl386.exe16/file.c +index 77908c2..b66b753 100644 +--- a/dlls/krnl386.exe16/file.c ++++ b/dlls/krnl386.exe16/file.c +@@ -539,6 +539,9 @@ INT16 WINAPI GetPrivateProfileString16( LPCSTR section, LPCSTR entry, + LPCSTR def_val, LPSTR buffer, + UINT16 len, LPCSTR filename ) + { ++ TRACE("(%s, %s, %s, %p, %u, %s)\n", debugstr_a(section), debugstr_a(entry), ++ debugstr_a(def_val), buffer, len, debugstr_a(filename)); ++ + if (!section) + { + if (buffer && len) buffer[0] = 0; +@@ -572,7 +575,12 @@ INT16 WINAPI GetPrivateProfileString16( LPCSTR section, LPCSTR entry, + { + char *p = strchr( src, '=' ); + +- if (!p) p = src + strlen(src); ++ /* A valid entry is formed by name = value */ ++ if (!p) ++ { ++ src += strlen(src) + 1; ++ continue; ++ } + if (p - src < len) + { + memcpy( buffer, src, p - src ); +-- +2.6.2 + diff --git a/patches/krnl386.exe-GetPrivateProfileString/definition b/patches/krnl386.exe-GetPrivateProfileString/definition new file mode 100644 index 00000000..7c1c31e2 --- /dev/null +++ b/patches/krnl386.exe-GetPrivateProfileString/definition @@ -0,0 +1 @@ +Fixes: [9919] Skip invalid entries in GetPrivateProfileString16 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 9ece3b0a..24206879 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -165,6 +165,7 @@ patch_enable_all () enable_kernel32_SetFileInformationByHandle="$1" enable_kernel32_TimezoneInformation_Registry="$1" enable_kernel32_VerifyVersionInfo="$1" + enable_krnl386_exe_GetPrivateProfileString="$1" enable_libs_Debug_Channel="$1" enable_libs_Unicode_Collation="$1" enable_makedep_PARENTSPEC="$1" @@ -602,6 +603,9 @@ patch_enable () kernel32-VerifyVersionInfo) enable_kernel32_VerifyVersionInfo="$2" ;; + krnl386.exe-GetPrivateProfileString) + enable_krnl386_exe_GetPrivateProfileString="$2" + ;; libs-Debug_Channel) enable_libs_Debug_Channel="$2" ;; @@ -3630,6 +3634,21 @@ if test "$enable_kernel32_VerifyVersionInfo" -eq 1; then ) >> "$patchlist" fi +# Patchset krnl386.exe-GetPrivateProfileString +# | +# | This patchset fixes the following Wine bugs: +# | * [#9919] Skip invalid entries in GetPrivateProfileString16 +# | +# | Modified files: +# | * dlls/krnl386.exe16/file.c +# | +if test "$enable_krnl386_exe_GetPrivateProfileString" -eq 1; then + patch_apply krnl386.exe-GetPrivateProfileString/0001-krnl386.exe16-Skip-invalid-entries-in-GetPrivateProf.patch + ( + echo '+ { "Bruno Jesus", "krnl386.exe16: Skip invalid entries in GetPrivateProfileString16.", 1 },'; + ) >> "$patchlist" +fi + # Patchset libs-Debug_Channel # | # | Modified files: diff --git a/staging/changelog b/staging/changelog index 80afaeab..af8e1391 100644 --- a/staging/changelog +++ b/staging/changelog @@ -13,6 +13,7 @@ wine-staging (1.8~rc2) UNRELEASED; urgency=low upstream). * Added patch to implement check for invalid handle type for HSPFILEQ handles. * Added patch for delayed end of DST in Europe/Istanbul. + * Added patch to skip invalid entries in GetPrivateProfileString16. -- Sebastian Lackner Wed, 25 Nov 2015 20:21:46 +0100 wine-staging (1.8~rc1) unstable; urgency=low