- Avoid use after free in debug configuration
CORE-8661 #resolve

svn path=/trunk/; revision=64862
This commit is contained in:
Jérôme Gardou 2014-10-21 10:45:49 +00:00
parent a336377ef4
commit 84c07bcc10

View file

@ -710,14 +710,15 @@ UserSetObjectOwner(PVOID obj, HANDLE_TYPE type, PVOID owner)
return; return;
} }
oldppi->UserHandleCount--;
IntDereferenceProcessInfo(oldppi);
ppi->UserHandleCount++;
IntReferenceProcessInfo(ppi);
#if DBG #if DBG
oldppi->DbgHandleCount[type]--; oldppi->DbgHandleCount[type]--;
ppi->DbgHandleCount[type]++; ppi->DbgHandleCount[type]++;
#endif #endif
oldppi->UserHandleCount--;
IntDereferenceProcessInfo(oldppi);
ppi->UserHandleCount++;
IntReferenceProcessInfo(ppi);
} }
BOOLEAN BOOLEAN