mirror of
https://github.com/reactos/reactos.git
synced 2024-09-10 12:54:51 +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]);
|
pidlFolder2 = (LPCITEMIDLIST) ((LPBYTE)pida + pida->aoffset[0]);
|
||||||
pidlChild = (LPCITEMIDLIST) ((LPBYTE)pida + pida->aoffset[1]);
|
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);
|
pidl = ILCombine(pidlFolder2, pidlChild);
|
||||||
|
|
||||||
GlobalUnlock(medium.hGlobal);
|
GlobalUnlock(medium.hGlobal);
|
||||||
|
@ -1344,12 +1352,6 @@ COpenWithMenu::Initialize(LPCITEMIDLIST pidlFolder,
|
||||||
ERR("no mem\n");
|
ERR("no mem\n");
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
if (!_ILIsValue(pidlChild))
|
|
||||||
{
|
|
||||||
TRACE("pidl is not a file\n");
|
|
||||||
SHFree((void*)pidl);
|
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!SHGetPathFromIDListW(pidl, m_wszPath))
|
if (!SHGetPathFromIDListW(pidl, m_wszPath))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue