From 6be1193f14a988c280e045e70c90df51e1b0fc26 Mon Sep 17 00:00:00 2001 From: Jiaxin Wu Date: Wed, 25 May 2016 16:22:26 +0800 Subject: NetworkPkg: Correct HttpConfigure parameter check When HttpConfigData is NULL, HttpConfigure should not return EFI_INVALID_PARAMETER. Cc: Ye Ting Cc: Fu Siyuan Cc: Zhang Lubo Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu Reviewed-by: Fu Siyuan Reviewed-by: Ye Ting Reviewed-by: Zhang Lubo --- NetworkPkg/HttpDxe/HttpImpl.c | 9 +++++---- NetworkPkg/HttpDxe/HttpImpl.h | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'NetworkPkg') diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index 7ee661316e..12f22dbbb1 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.c +++ b/NetworkPkg/HttpDxe/HttpImpl.c @@ -114,7 +114,6 @@ EfiHttpGetModeData ( @retval EFI_SUCCESS Operation succeeded. @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: This is NULL. - HttpConfigData is NULL. HttpConfigData->LocalAddressIsIPv6 is FALSE and HttpConfigData->IPv4Node is NULL. HttpConfigData->LocalAddressIsIPv6 is TRUE and @@ -141,9 +140,9 @@ EfiHttpConfigure ( // Check input parameters. // if (This == NULL || - HttpConfigData == NULL || - ((HttpConfigData->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv6Node == NULL) || - (!HttpConfigData->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv4Node == NULL))) { + (HttpConfigData != NULL && + ((HttpConfigData->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv6Node == NULL) || + (!HttpConfigData->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv4Node == NULL)))) { return EFI_INVALID_PARAMETER; } @@ -254,6 +253,7 @@ EfiHttpRequest ( // Url = NULL; UrlParser = NULL; + RemotePort = 0; HostName = NULL; RequestMsg = NULL; HostNameStr = NULL; @@ -908,6 +908,7 @@ HttpResponseWorker ( SizeofHeaders = 0; BufferSize = 0; EndofHeader = NULL; + ValueInItem = NULL; if (HttpMsg->Data.Response != NULL) { // diff --git a/NetworkPkg/HttpDxe/HttpImpl.h b/NetworkPkg/HttpDxe/HttpImpl.h index 415b5e5e95..40b25048bc 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.h +++ b/NetworkPkg/HttpDxe/HttpImpl.h @@ -72,7 +72,6 @@ EfiHttpGetModeData ( @retval EFI_SUCCESS Operation succeeded. @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: This is NULL. - HttpConfigData is NULL. HttpConfigData->LocalAddressIsIPv6 is FALSE and HttpConfigData->IPv4Node is NULL. HttpConfigData->LocalAddressIsIPv6 is TRUE and -- cgit v1.2.3