mirror of
https://github.com/reactos/reactos.git
synced 2026-06-08 00:46:10 +08:00
[SHELL32][SHELLEXT] IEnumIDList::Next must handle pceltFetched and memory errors correctly (#5820)
- pceltFetched can be NULL if the caller is not requesting multiple items. - All entries returned in rgelt must be valid, they cannot be NULL.
This commit is contained in:
@@ -277,9 +277,17 @@ CEnumIDList::Next(
|
||||
for (i = 0; i < celt; i++)
|
||||
{
|
||||
if (!m_pCurrent)
|
||||
{
|
||||
hr = S_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
temp = ILClone(m_pCurrent->pidl);
|
||||
if (!temp)
|
||||
{
|
||||
hr = i ? S_FALSE : E_OUTOFMEMORY;
|
||||
break;
|
||||
}
|
||||
rgelt[i] = temp;
|
||||
m_pCurrent = m_pCurrent->pNext;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user