diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index e73265b4..73282387 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -363,6 +363,7 @@ patch_enable_all () enable_shell32_SHELL_execute="$1" enable_shell32_SHFileOperation_Move="$1" enable_shell32_SHFileOperation_Win9x="$1" + enable_shell32_SHGetFileInfoW="$1" enable_shell32_Toolbar_Bitmaps="$1" enable_shell32_UnixFS="$1" enable_shlwapi_AssocGetPerceivedType="$1" @@ -1344,6 +1345,9 @@ patch_enable () shell32-SHFileOperation_Win9x) enable_shell32_SHFileOperation_Win9x="$2" ;; + shell32-SHGetFileInfoW) + enable_shell32_SHGetFileInfoW="$2" + ;; shell32-Toolbar_Bitmaps) enable_shell32_Toolbar_Bitmaps="$2" ;; @@ -7853,6 +7857,18 @@ if test "$enable_shell32_SHFileOperation_Win9x" -eq 1; then ) >> "$patchlist" fi +# Patchset shell32-SHGetFileInfoW +# | +# | Modified files: +# | * dlls/shell32/shell32_main.c +# | +if test "$enable_shell32_SHGetFileInfoW" -eq 1; then + patch_apply shell32-SHGetFileInfoW/0001-shell32-Prevent-a-possible-nullptr-dereference-in-SH.patch + ( + printf '%s\n' '+ { "Mark Jansen", "shell32: Prevent a possible nullptr dereference in SHGetFileInfoW.", 1 },'; + ) >> "$patchlist" +fi + # Patchset shell32-Toolbar_Bitmaps # | # | This patchset fixes the following Wine bugs: diff --git a/patches/shell32-SHGetFileInfoW/0001-shell32-Prevent-a-possible-nullptr-dereference-in-SH.patch b/patches/shell32-SHGetFileInfoW/0001-shell32-Prevent-a-possible-nullptr-dereference-in-SH.patch new file mode 100644 index 00000000..351fab3b --- /dev/null +++ b/patches/shell32-SHGetFileInfoW/0001-shell32-Prevent-a-possible-nullptr-dereference-in-SH.patch @@ -0,0 +1,26 @@ +From a7db8be54b079a52c392d6f1e7be86792b60900a Mon Sep 17 00:00:00 2001 +From: Mark Jansen +Date: Sun, 16 Jul 2017 16:27:12 +0200 +Subject: shell32: Prevent a possible nullptr dereference in SHGetFileInfoW. + +Signed-off-by: Mark Jansen +--- + dlls/shell32/shell32_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c +index 34b906c2fd5..0ed67907ca1 100644 +--- a/dlls/shell32/shell32_main.c ++++ b/dlls/shell32/shell32_main.c +@@ -431,7 +431,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, + + TRACE("%s fattr=0x%x sfi=%p(attr=0x%08x) size=0x%x flags=0x%x\n", + (flags & SHGFI_PIDL)? "pidl" : debugstr_w(path), dwFileAttributes, +- psfi, psfi->dwAttributes, sizeofpsfi, flags); ++ psfi, psfi ? psfi->dwAttributes : 0, sizeofpsfi, flags); + + if (!path) + return FALSE; +-- +2.13.1 + diff --git a/patches/shell32-SHGetFileInfoW/definition b/patches/shell32-SHGetFileInfoW/definition new file mode 100644 index 00000000..ba6de303 --- /dev/null +++ b/patches/shell32-SHGetFileInfoW/definition @@ -0,0 +1 @@ +Fixes: Prevent a possible nullptr dereference in SHGetFileInfoW