mirror of
https://github.com/reactos/reactos.git
synced 2024-07-13 16:15:05 +00:00
[SHELL32]
- Fix a use after free in COpenWithMenu::Initialize. Powered by DPH. svn path=/trunk/; revision=65156
This commit is contained in:
parent
e62a1d0299
commit
52f76a303d
|
@ -1334,6 +1334,14 @@ COpenWithMenu::Initialize(LPCITEMIDLIST pidlFolder,
|
|||
pidlFolder2 = (LPCITEMIDLIST) ((LPBYTE)pida + pida->aoffset[0]);
|
||||
pidlChild = (LPCITEMIDLIST) ((LPBYTE)pida + pida->aoffset[1]);
|
||||
|
||||
if (!_ILIsValue(pidlChild))
|
||||
{
|
||||
TRACE("pidl is not a file\n");
|
||||
GlobalUnlock(medium.hGlobal);
|
||||
GlobalFree(medium.hGlobal);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
pidl = ILCombine(pidlFolder2, pidlChild);
|
||||
|
||||
GlobalUnlock(medium.hGlobal);
|
||||
|
@ -1344,12 +1352,6 @@ COpenWithMenu::Initialize(LPCITEMIDLIST pidlFolder,
|
|||
ERR("no mem\n");
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
if (!_ILIsValue(pidlChild))
|
||||
{
|
||||
TRACE("pidl is not a file\n");
|
||||
SHFree((void*)pidl);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (!SHGetPathFromIDListW(pidl, m_wszPath))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue