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:
@@ -1612,6 +1612,7 @@ Udp4Demultiplex (
|
||||
// Get the datagram header from the packet buffer.
|
||||
//
|
||||
Udp4Header = (EFI_UDP_HEADER *) NetbufGetByte (Packet, 0, NULL);
|
||||
ASSERT (Udp4Header != NULL);
|
||||
|
||||
if (Udp4Header->Checksum != 0) {
|
||||
//
|
||||
@@ -1799,6 +1800,7 @@ Udp4IcmpHandler (
|
||||
UDP4_INSTANCE_DATA *Instance;
|
||||
|
||||
Udp4Header = (EFI_UDP_HEADER *) NetbufGetByte (Packet, 0, NULL);
|
||||
ASSERT (Udp4Header != NULL);
|
||||
|
||||
CopyMem (&Udp4Session.SourceAddress, &NetSession->Source, sizeof (EFI_IPv4_ADDRESS));
|
||||
CopyMem (&Udp4Session.DestinationAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS));
|
||||
|
Reference in New Issue
Block a user