]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpDxe/HttpImpl.c
CryptoPkg ARM: add ArmSoftFloatLib resolution to CryptoPkg.dsc
[mirror_edk2.git] / NetworkPkg / HttpDxe / HttpImpl.c
index 4ad07d4f230b5cf72d0187c3ece1f225a66450fe..0fa437dc327d977767987926fc26519fdd6e7a72 100644 (file)
@@ -40,6 +40,7 @@ EFI_HTTP_PROTOCOL  mEfiHttpTemplate = {
                                   This is NULL.\r
                                   HttpConfigData is NULL.\r
                                   HttpConfigData->AccessPoint is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES    Could not allocate enough system resources.\r
   @retval EFI_NOT_STARTED         The HTTP instance is not configured.\r
 \r
 **/\r
@@ -71,6 +72,9 @@ EfiHttpGetModeData (
 \r
   if (HttpInstance->LocalAddressIsIPv6) {\r
     Http6AccessPoint = AllocateZeroPool (sizeof (EFI_HTTPv6_ACCESS_POINT));\r
+    if (Http6AccessPoint == NULL) {\r
+      return EFI_OUT_OF_RESOURCES;\r
+    }\r
     CopyMem (\r
       Http6AccessPoint,\r
       &HttpInstance->Ipv6Node,\r
@@ -79,6 +83,9 @@ EfiHttpGetModeData (
     HttpConfigData->AccessPoint.IPv6Node = Http6AccessPoint;\r
   } else {\r
     Http4AccessPoint = AllocateZeroPool (sizeof (EFI_HTTPv4_ACCESS_POINT));\r
+    if (Http4AccessPoint == NULL) {\r
+      return EFI_OUT_OF_RESOURCES;\r
+    }\r
     CopyMem (\r
       Http4AccessPoint,\r
       &HttpInstance->IPv4Node,\r
@@ -885,6 +892,8 @@ HttpResponseWorker (
       goto Error;\r
     }\r
 \r
+    ASSERT (HttpHeaders != NULL);\r
+\r
     //\r
     // Cache the part of body.\r
     //\r
@@ -1287,14 +1296,19 @@ EfiHttpPoll (
   HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);\r
   ASSERT (HttpInstance != NULL);\r
 \r
-  if (HttpInstance->State != HTTP_STATE_TCP_CONNECTED || (HttpInstance->Tcp4 == NULL && \r
-                                                          HttpInstance->Tcp6 == NULL)) {\r
+  if (HttpInstance->State != HTTP_STATE_TCP_CONNECTED) {\r
     return EFI_NOT_STARTED;\r
   }\r
   \r
   if (HttpInstance->LocalAddressIsIPv6) {\r
+    if (HttpInstance->Tcp6 == NULL) {\r
+      return EFI_NOT_STARTED;\r
+    }\r
     Status = HttpInstance->Tcp6->Poll (HttpInstance->Tcp6);\r
   } else {\r
+    if (HttpInstance->Tcp4 == NULL) {\r
+      return EFI_NOT_STARTED;\r
+    }\r
     Status = HttpInstance->Tcp4->Poll (HttpInstance->Tcp4);\r
   }\r
   \r