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:
@@ -849,7 +849,8 @@ Ip4AccpetFrame (
|
||||
goto DROP;
|
||||
}
|
||||
|
||||
Head = (IP4_HEAD *) NetbufGetByte (Packet, 0, NULL);
|
||||
Head = (IP4_HEAD *) NetbufGetByte (Packet, 0, NULL);
|
||||
ASSERT (Head != NULL);
|
||||
OptionLen = (Head->HeadLen << 2) - IP4_MIN_HEADLEN;
|
||||
if (OptionLen > 0) {
|
||||
Option = (UINT8 *) (Head + 1);
|
||||
@@ -899,6 +900,7 @@ Ip4AccpetFrame (
|
||||
// is transfered to the packet process logic.
|
||||
//
|
||||
Head = (IP4_HEAD *) NetbufGetByte (Packet, 0, NULL);
|
||||
ASSERT (Head != NULL);
|
||||
Status = Ip4PreProcessPacket (
|
||||
IpSb,
|
||||
&Packet,
|
||||
|
Reference in New Issue
Block a user