summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/HttpBootDxe
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2018-03-01 11:52:28 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2018-03-02 11:14:52 +0800
commit951c6e63f8dbcf9eb4c720cf218cb7ede7a7255e (patch)
tree8933f6b098a9a5c9cd1c34ec0438830449a1ab66 /NetworkPkg/HttpBootDxe
parent5ac0a5450bb87ccefa9f847d3d5bf579cb13925e (diff)
downloadedk2-951c6e63f8dbcf9eb4c720cf218cb7ede7a7255e.tar.gz
edk2-951c6e63f8dbcf9eb4c720cf218cb7ede7a7255e.tar.bz2
edk2-951c6e63f8dbcf9eb4c720cf218cb7ede7a7255e.zip
NetworkPkg/HttpBootDxe: Correct the parameter check for the usage of HttpBootGetFileFromCache.
The patch is to fix the incorrect parameter check for the HttpBootGetFileFromCache(). Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
Diffstat (limited to 'NetworkPkg/HttpBootDxe')
-rw-r--r--NetworkPkg/HttpBootDxe/HttpBootClient.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/NetworkPkg/HttpBootDxe/HttpBootClient.c b/NetworkPkg/HttpBootDxe/HttpBootClient.c
index 15e0ab9d69..b93e63bb2f 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootClient.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootClient.c
@@ -1,7 +1,7 @@
/** @file
Implementation of the boot file download function.
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
@@ -436,7 +436,7 @@ HttpBootDhcp6ExtractUriInfo (
}
//
- // Extract the HTTP server Ip frome URL. This is used to Check route table
+ // Extract the HTTP server Ip from URL. This is used to Check route table
// whether can send message to HTTP Server Ip through the GateWay.
//
Status = HttpUrlGetIp6 (
@@ -746,7 +746,7 @@ HttpBootGetFileFromCache (
HTTP_BOOT_ENTITY_DATA *EntityData;
UINTN CopyedSize;
- if (Uri == NULL || BufferSize == 0 || Buffer == NULL || ImageType == NULL) {
+ if (Uri == NULL || BufferSize == NULL || Buffer == NULL || ImageType == NULL) {
return EFI_INVALID_PARAMETER;
}
@@ -757,8 +757,7 @@ HttpBootGetFileFromCache (
//
if ((Cache->RequestData != NULL) &&
(Cache->RequestData->Url != NULL) &&
- (StrCmp (Uri, Cache->RequestData->Url) == 0))
- {
+ (StrCmp (Uri, Cache->RequestData->Url) == 0)) {
//
// Hit in cache, record image type.
//
@@ -947,7 +946,7 @@ HttpBootGetBootFile (
return EFI_OUT_OF_RESOURCES;
}
AsciiStrToUnicodeStrS (Private->BootFileUri, Url, UrlSize);
- if (!HeaderOnly) {
+ if (!HeaderOnly && Buffer != NULL) {
Status = HttpBootGetFileFromCache (Private, Url, BufferSize, Buffer, ImageType);
if (Status != EFI_NOT_FOUND) {
FreePool (Url);
@@ -1129,7 +1128,7 @@ HttpBootGetBootFile (
Context.Cache = Cache;
Context.Private = Private;
Status = HttpInitMsgParser (
- HeaderOnly? HttpMethodHead : HttpMethodGet,
+ HeaderOnly ? HttpMethodHead : HttpMethodGet,
ResponseData->Response.StatusCode,
ResponseData->HeaderCount,
ResponseData->Headers,