mirror of
https://github.com/reactos/reactos.git
synced 2025-04-28 01:11:35 +00:00
[TCPIP] Check buffer before dereferencing it
CID 716664
This commit is contained in:
parent
0150bb964a
commit
f76a097a25
1 changed files with 3 additions and 3 deletions
|
@ -312,13 +312,13 @@ TDI_STATUS InfoTdiSetRoute(PIP_INTERFACE IF, PVOID Buffer, UINT BufferSize)
|
|||
IP_ADDRESS Address, Netmask, Router;
|
||||
PIPROUTE_ENTRY Route = Buffer;
|
||||
|
||||
if (!Buffer || BufferSize < sizeof(IPROUTE_ENTRY))
|
||||
return TDI_INVALID_PARAMETER;
|
||||
|
||||
AddrInitIPv4( &Address, Route->Dest );
|
||||
AddrInitIPv4( &Netmask, Route->Mask );
|
||||
AddrInitIPv4( &Router, Route->Gw );
|
||||
|
||||
if (!Buffer || BufferSize < sizeof(IPROUTE_ENTRY))
|
||||
return TDI_INVALID_PARAMETER;
|
||||
|
||||
if (IF == Loopback)
|
||||
{
|
||||
DbgPrint("Failing attempt to add route to loopback adapter\n");
|
||||
|
|
Loading…
Reference in a new issue