summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/HttpDxe
diff options
context:
space:
mode:
authorFu Siyuan <siyuan.fu@intel.com>2015-09-16 08:52:24 +0000
committersfu5 <sfu5@Edk2>2015-09-16 08:52:24 +0000
commita8706acb0ee847c1521bd8db71c144fd24480e0b (patch)
tree5cc94a023dbbc446fc9f64d9f4509763b5978cc9 /NetworkPkg/HttpDxe
parentc9e240316cdcc99e036ad203de9e611638f706b4 (diff)
downloadedk2-a8706acb0ee847c1521bd8db71c144fd24480e0b.tar.gz
edk2-a8706acb0ee847c1521bd8db71c144fd24480e0b.tar.bz2
edk2-a8706acb0ee847c1521bd8db71c144fd24480e0b.zip
NetworkPkg: Enhance the NULL pointer check before dereference it.
This patch enhances the NULL pointer check of the HttpInstance->RemoteHost pointer before dereference it. 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/trunk/edk2@18482 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg/HttpDxe')
-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;
}
}
}