]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpProto.c
NetworkPkg/HttpDxe: Fix the potential NULL dereference
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpProto.c
index 36c61e2e997adba39f9b02de8fa4c16eac58646b..199d575cf906a0c68f21db24439755f3d49c2ab4 100644 (file)
@@ -1655,6 +1655,8 @@ HttpTcpTransmit (
   UINTN                     UrlSize;\r
   UINTN                     RequestMsgSize;\r
 \r
+  RequestMsg = NULL;\r
+\r
   ValueInItem = (HTTP_TOKEN_WRAP *) Item->Value;\r
   if (ValueInItem->TcpWrap.IsTxDone) {\r
     return EFI_SUCCESS;\r
@@ -1682,10 +1684,12 @@ HttpTcpTransmit (
                  );\r
   FreePool (Url);\r
 \r
-  if (EFI_ERROR (Status)){\r
+  if (EFI_ERROR (Status) || NULL == RequestMsg){\r
     return Status;\r
   }\r
 \r
+  ASSERT (RequestMsg != NULL);\r
+\r
   //\r
   // Transmit the request message.\r
   //\r