]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c
Add more check to make code more safely.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Mtftp4Dxe / Mtftp4Support.c
index 26860e52bb4b9fc19013d7cc4bf6d750efbb62c7..90207a2a9d66cdf3b85a8e316cf95a0b13b6b0e4 100644 (file)
@@ -465,6 +465,7 @@ Mtftp4SendPacket (
   // to the connected port\r
   //\r
   Value = *((UINT16 *) NetbufGetByte (Packet, 0, NULL));\r
+  ASSERT (Value != NULL);\r
   OpCode = NTOHS (Value);\r
 \r
   if ((OpCode == EFI_MTFTP4_OPCODE_RRQ) || \r
@@ -522,6 +523,7 @@ Mtftp4Retransmit (
   // Set the requests to the listening port, other packets to the connected port\r
   //\r
   Value = *(UINT16 *) NetbufGetByte (Instance->LastPacket, 0, NULL);\r
+  ASSERT (Value != NULL);\r
   OpCode = NTOHS (Value);\r
 \r
   if ((OpCode == EFI_MTFTP4_OPCODE_RRQ) || (OpCode == EFI_MTFTP4_OPCODE_DIR) ||\r