From 15934680f7665ea8ca5afddbef1606b356424ac8 Mon Sep 17 00:00:00 2001 From: Michael Jung Date: Fri, 6 May 2005 19:33:06 +0000 Subject: [PATCH] Return a cloned PIDL by SHBrowseForFolder to avoid heap corruption. --- dlls/shell32/brsfolder.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/shell32/brsfolder.c b/dlls/shell32/brsfolder.c index 651dc27abb1..52c5d5f5b21 100644 --- a/dlls/shell32/brsfolder.c +++ b/dlls/shell32/brsfolder.c @@ -521,6 +521,7 @@ static BOOL BrsFolder_OnCommand( browse_info *info, UINT id ) switch (id) { case IDOK: + info->pidlRet = ILClone(info->pidlRet); /* The original pidl will be free'd. */ pdump( info->pidlRet ); if (lpBrowseInfo->pszDisplayName) SHGetPathFromIDListW( info->pidlRet, lpBrowseInfo->pszDisplayName ); @@ -664,8 +665,6 @@ LPITEMIDLIST WINAPI SHBrowseForFolderW (LPBROWSEINFOW lpbi) browse_info info; DWORD r; - ERR("%p\n", lpbi); - info.hWnd = 0; info.pidlRet = NULL; info.lpBrowseInfo = lpbi;