Module: wine Branch: master Commit: a8c2d4b5bc841b48163811eab92e1c29114d5fdd URL: http://source.winehq.org/git/wine.git/?a=commit;h=a8c2d4b5bc841b48163811eab9...
Author: Vincent Povirk vincent@codeweavers.com Date: Sun Dec 13 18:59:13 2009 -0600
shell32: Fix an uninitialized memory access in SHGetFileInfoW.
If we are passed SHGFI_PIDL, szFullPath is not initialized. If we're passed the flags PIDL, USEFILEATTRIBUTES, and an icon flag, we will try to use the uninitialized filename to get the icon. Since the test claims that the function should return an icon in this case, and we cannot always convert a pidl to a path, we should just use the pidl.
---
dlls/shell32/shell32_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c index 2334e62..91795b9 100644 --- a/dlls/shell32/shell32_main.c +++ b/dlls/shell32/shell32_main.c @@ -565,7 +565,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, /* get icon index (or load icon)*/ if (SUCCEEDED(hr) && (flags & (SHGFI_ICON | SHGFI_SYSICONINDEX))) { - if (flags & SHGFI_USEFILEATTRIBUTES) + if (flags & SHGFI_USEFILEATTRIBUTES && !(flags & SHGFI_PIDL)) { WCHAR sTemp [MAX_PATH]; WCHAR * szExt;