mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:35:47 +00:00
* Fixed the buffer allocation in NtAccecptConnectedPort.
svn path=/trunk/; revision=3697
This commit is contained in:
parent
39537ca751
commit
fb46b3c16a
1 changed files with 13 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: connect.c,v 1.13 2002/11/03 20:01:06 chorns Exp $
|
/* $Id: connect.c,v 1.14 2002/11/05 20:27:56 hbirr Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -517,9 +517,15 @@ NtAcceptConnectPort (PHANDLE ServerPortHandle,
|
||||||
KIRQL oldIrql;
|
KIRQL oldIrql;
|
||||||
PEPORT_CONNECT_REQUEST_MESSAGE CRequest;
|
PEPORT_CONNECT_REQUEST_MESSAGE CRequest;
|
||||||
PEPORT_CONNECT_REPLY_MESSAGE CReply;
|
PEPORT_CONNECT_REPLY_MESSAGE CReply;
|
||||||
|
ULONG Size;
|
||||||
|
|
||||||
CReply = ExAllocatePool(NonPagedPool,
|
Size = sizeof(EPORT_CONNECT_REPLY_MESSAGE);
|
||||||
sizeof(EPORT_CONNECT_REPLY_MESSAGE) + LpcMessage->DataSize);
|
if (LpcMessage)
|
||||||
|
{
|
||||||
|
Size += LpcMessage->DataSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
CReply = ExAllocatePool(NonPagedPool, Size);
|
||||||
if (CReply == NULL)
|
if (CReply == NULL)
|
||||||
{
|
{
|
||||||
return(STATUS_NO_MEMORY);
|
return(STATUS_NO_MEMORY);
|
||||||
|
@ -540,7 +546,7 @@ NtAcceptConnectPort (PHANDLE ServerPortHandle,
|
||||||
/*
|
/*
|
||||||
* Create a port object for our side of the connection
|
* Create a port object for our side of the connection
|
||||||
*/
|
*/
|
||||||
if (AcceptIt == 1)
|
if (AcceptIt)
|
||||||
{
|
{
|
||||||
Status = ObCreateObject(ServerPortHandle,
|
Status = ObCreateObject(ServerPortHandle,
|
||||||
PORT_ALL_ACCESS,
|
PORT_ALL_ACCESS,
|
||||||
|
@ -549,6 +555,7 @@ NtAcceptConnectPort (PHANDLE ServerPortHandle,
|
||||||
(PVOID*)&OurPort);
|
(PVOID*)&OurPort);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
ExFreePool(CReply);
|
||||||
ObDereferenceObject(NamedPort);
|
ObDereferenceObject(NamedPort);
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
@ -584,7 +591,7 @@ NtAcceptConnectPort (PHANDLE ServerPortHandle,
|
||||||
sizeof(LPC_MESSAGE);
|
sizeof(LPC_MESSAGE);
|
||||||
CReply->ConnectDataLength = 0;
|
CReply->ConnectDataLength = 0;
|
||||||
}
|
}
|
||||||
if (AcceptIt != 1)
|
if (!AcceptIt)
|
||||||
{
|
{
|
||||||
EiReplyOrRequestPort(ConnectionRequest->Sender,
|
EiReplyOrRequestPort(ConnectionRequest->Sender,
|
||||||
&CReply->MessageHeader,
|
&CReply->MessageHeader,
|
||||||
|
@ -707,6 +714,7 @@ NtAcceptConnectPort (PHANDLE ServerPortHandle,
|
||||||
LPC_REPLY,
|
LPC_REPLY,
|
||||||
OurPort);
|
OurPort);
|
||||||
ExFreePool(ConnectionRequest);
|
ExFreePool(ConnectionRequest);
|
||||||
|
ExFreePool(CReply);
|
||||||
|
|
||||||
ObDereferenceObject(OurPort);
|
ObDereferenceObject(OurPort);
|
||||||
ObDereferenceObject(NamedPort);
|
ObDereferenceObject(NamedPort);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue