&ResultLength\r
);\r
if (EFI_ERROR (Status)) {\r
+ FreePool (Name);\r
return Status;\r
}\r
\r
&ResultLength\r
);\r
if (EFI_ERROR (Status)) {\r
+ FreePool (Ip4String);\r
return Status;\r
}\r
\r
&ResultLength\r
);\r
if (EFI_ERROR (Status)) {\r
+ FreePool (Ip6String);\r
return Status;\r
}\r
\r
{\r
CHAR8 *PortString;\r
EFI_STATUS Status;\r
+ UINTN Index;\r
UINTN Data;\r
UINT32 ResultLength;\r
HTTP_URL_PARSER *Parser;\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
+ *Port = 0;\r
+ Index = 0;\r
+\r
Parser = (HTTP_URL_PARSER*) UrlParser;\r
\r
if ((Parser->FieldBitMap & BIT (HTTP_URI_FIELD_PORT)) == 0) {\r
&ResultLength\r
);\r
if (EFI_ERROR (Status)) {\r
- return Status;\r
+ goto ON_EXIT;\r
}\r
\r
PortString[ResultLength] = '\0';\r
\r
+ while (Index < ResultLength) {\r
+ if (!NET_IS_DIGIT (PortString[Index])) {\r
+ Status = EFI_INVALID_PARAMETER;\r
+ goto ON_EXIT;\r
+ }\r
+ Index ++;\r
+ }\r
+\r
Status = AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, &Data);\r
\r
+ if (Data > HTTP_URI_PORT_MAX_NUM) {\r
+ Status = EFI_INVALID_PARAMETER;\r
+ goto ON_EXIT;\r
+ }\r
+\r
*Port = (UINT16) Data;\r
+\r
+ON_EXIT:\r
+ FreePool (PortString);\r
return Status;\r
}\r
\r
&ResultLength\r
);\r
if (EFI_ERROR (Status)) {\r
+ FreePool (PathStr);\r
return Status;\r
}\r
\r