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
\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
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
)\r
{\r
HTTP_TOKEN_WRAP *Wrap;\r
+ UINTN BodyLength;\r
+ CHAR8 *Body;\r
\r
if (EventType != BodyParseEventOnComplete) {\r
return EFI_SUCCESS;\r
}\r
\r
Wrap = (HTTP_TOKEN_WRAP *) Context;\r
- Wrap->HttpInstance->NextMsg = Data;\r
+ Body = Wrap->HttpToken->Message->Body;\r
+ BodyLength = Wrap->HttpToken->Message->BodyLength;\r
+ if (Data < Body + BodyLength) {\r
+ Wrap->HttpInstance->NextMsg = Data;\r
+ } else {\r
+ Wrap->HttpInstance->NextMsg = NULL;\r
+ }\r
+ \r
\r
//\r
// Free Tx4Token or Tx6Token since already received corrsponding HTTP response.\r
goto Error;\r
}\r
\r
+ ASSERT (HttpHeaders != NULL);\r
+\r
//\r
// Cache the part of body.\r
//\r
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