Add more check to make code more safely.
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Ouyang Qian <ouyang.qian@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13903 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -710,6 +710,7 @@ TcpInput (
|
||||
Tcb = NULL;
|
||||
|
||||
Head = (TCP_HEAD *) NetbufGetByte (Nbuf, 0, NULL);
|
||||
ASSERT (Head != NULL);
|
||||
Len = Nbuf->TotalSize - (Head->HeadLen << 2);
|
||||
|
||||
if ((Head->HeadLen < 5) || (Len < 0) ||
|
||||
@ -1422,6 +1423,7 @@ TcpIcmpInput (
|
||||
BOOLEAN IcmpErrNotify;
|
||||
|
||||
Head = (TCP_HEAD *) NetbufGetByte (Nbuf, 0, NULL);
|
||||
ASSERT (Head != NULL);
|
||||
Tcb = TcpLocateTcb (
|
||||
Head->DstPort,
|
||||
Dst,
|
||||
|
Reference in New Issue
Block a user