summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b254914)
- Avoid dereferencing a null pointer in LpcpDeletePort. By Samuel SerapiĆ³n.
CORE-6850 #resolve
svn path=/trunk/; revision=71673
/* Dereference the object unless it's the same port */
if (ConnectionPort != Port) ObDereferenceObject(ConnectionPort);
/* Dereference the object unless it's the same port */
if (ConnectionPort != Port) ObDereferenceObject(ConnectionPort);
+
+ /* Check if this is a connection port with a server process */
+ if (((Port->Flags & LPCP_PORT_TYPE_MASK) == LPCP_CONNECTION_PORT) &&
+ (ConnectionPort->ServerProcess))
+ {
+ /* Dereference the server process */
+ ObDereferenceObject(ConnectionPort->ServerProcess);
+ ConnectionPort->ServerProcess = NULL;
+ }
KeReleaseGuardedMutex(&LpcpLock);
}
KeReleaseGuardedMutex(&LpcpLock);
}
- /* Check if this is a connection port with a server process */
- if (((Port->Flags & LPCP_PORT_TYPE_MASK) == LPCP_CONNECTION_PORT) &&
- (ConnectionPort->ServerProcess))
- {
- /* Dereference the server process */
- ObDereferenceObject(ConnectionPort->ServerProcess);
- ConnectionPort->ServerProcess = NULL;
- }
-
/* Free client security */
LpcpFreePortClientSecurity(Port);
LPCTRACE(LPC_CLOSE_DEBUG, "Port: %p deleted\n", Port);
/* Free client security */
LpcpFreePortClientSecurity(Port);
LPCTRACE(LPC_CLOSE_DEBUG, "Port: %p deleted\n", Port);