From a8706acb0ee847c1521bd8db71c144fd24480e0b Mon Sep 17 00:00:00 2001 From: Fu Siyuan Date: Wed, 16 Sep 2015 08:52:24 +0000 Subject: [PATCH] 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 Reviewed-by: Ye Ting git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18482 6f19259b-4bc3-4df7-8a09-765794883524 --- NetworkPkg/HttpDxe/HttpImpl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } } }