summaryrefslogtreecommitdiff
path: root/NetworkPkg
diff options
context:
space:
mode:
authorFu Siyuan <siyuan.fu@intel.com>2015-09-17 00:54:45 +0000
committerhwu1225 <hwu1225@Edk2>2015-09-17 00:54:45 +0000
commit3d4bfa3c396c5b6e10652b03ea13238d45bc4abb (patch)
tree612d09b754b6f75dc9abce148352bc4a3035b966 /NetworkPkg
parentb2953a39cc17d49974ebbd66fb4449f326f323fc (diff)
downloadedk2-platforms-3d4bfa3c396c5b6e10652b03ea13238d45bc4abb.tar.xz
NetworkPkg: Enhance the NULL pointer check before dereference it.
This patch enhances the NULL pointer check of the HttpInstance->RemoteHost pointer before dereference it. (Sync patch r18482 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18485 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/HttpDxe/HttpImpl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index 76c95b2bb6..50c0617436 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -316,7 +316,7 @@ EfiHttpRequest (
Configure = TRUE;
ReConfigure = TRUE;
- if (HttpInstance->RemoteHost == NULL && HttpInstance->RemotePort == 0) {
+ if (HttpInstance->RemoteHost == NULL) {
//
// Request() is called the first time.
//
@@ -373,6 +373,7 @@ EfiHttpRequest (
if (HttpInstance->RemoteHost != NULL) {
FreePool (HttpInstance->RemoteHost);
HttpInstance->RemoteHost = NULL;
+ HttpInstance->RemotePort = 0;
}
}
}