NetworkPkg: Correct HttpConfigure parameter check
authorJiaxin Wu <jiaxin.wu@intel.com>
Wed, 25 May 2016 08:22:26 +0000 (16:22 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Thu, 26 May 2016 08:10:55 +0000 (16:10 +0800)
When HttpConfigData is NULL, HttpConfigure should not return
EFI_INVALID_PARAMETER.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Zhang Lubo <lubo.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
NetworkPkg/HttpDxe/HttpImpl.c
NetworkPkg/HttpDxe/HttpImpl.h

index 7ee661316e0f19b4ef4ad027fdc1adfe194d1d9a..12f22dbbb14be991df57da3d16cce03a64d5d260 100644 (file)
@@ -114,7 +114,6 @@ EfiHttpGetModeData (
   @retval EFI_SUCCESS             Operation succeeded.\r
   @retval EFI_INVALID_PARAMETER   One or more of the following conditions is TRUE:\r
                                   This is NULL.\r
-                                  HttpConfigData is NULL.\r
                                   HttpConfigData->LocalAddressIsIPv6 is FALSE and\r
                                   HttpConfigData->IPv4Node is NULL.\r
                                   HttpConfigData->LocalAddressIsIPv6 is TRUE and\r
@@ -141,9 +140,9 @@ EfiHttpConfigure (
   // Check input parameters.\r
   //\r
   if (This == NULL ||\r
-      HttpConfigData == NULL ||\r
-     ((HttpConfigData->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv6Node == NULL) ||\r
-     (!HttpConfigData->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv4Node == NULL))) {\r
+      (HttpConfigData != NULL && \r
+       ((HttpConfigData->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv6Node == NULL) ||\r
+        (!HttpConfigData->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv4Node == NULL)))) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -254,6 +253,7 @@ EfiHttpRequest (
   //\r
   Url = NULL;\r
   UrlParser = NULL;\r
+  RemotePort = 0;\r
   HostName = NULL;\r
   RequestMsg = NULL;\r
   HostNameStr = NULL;\r
@@ -908,6 +908,7 @@ HttpResponseWorker (
   SizeofHeaders             = 0;\r
   BufferSize                = 0;\r
   EndofHeader               = NULL;\r
+  ValueInItem               = NULL;\r
  \r
   if (HttpMsg->Data.Response != NULL) {\r
     //\r
index 415b5e5e95c0813737717d4ab651b48c65614945..40b25048bc7302b6ad3f324e74bda00b01ee3711 100644 (file)
@@ -72,7 +72,6 @@ EfiHttpGetModeData (
   @retval EFI_SUCCESS             Operation succeeded.\r
   @retval EFI_INVALID_PARAMETER   One or more of the following conditions is TRUE:\r
                                   This is NULL.\r
-                                  HttpConfigData is NULL.\r
                                   HttpConfigData->LocalAddressIsIPv6 is FALSE and\r
                                   HttpConfigData->IPv4Node is NULL.\r
                                   HttpConfigData->LocalAddressIsIPv6 is TRUE and\r