mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
c9e240316c
commit
a8706acb0e
|
@ -316,7 +316,7 @@ EfiHttpRequest (
|
||||||
Configure = TRUE;
|
Configure = TRUE;
|
||||||
ReConfigure = TRUE;
|
ReConfigure = TRUE;
|
||||||
|
|
||||||
if (HttpInstance->RemoteHost == NULL && HttpInstance->RemotePort == 0) {
|
if (HttpInstance->RemoteHost == NULL) {
|
||||||
//
|
//
|
||||||
// Request() is called the first time.
|
// Request() is called the first time.
|
||||||
//
|
//
|
||||||
|
@ -373,6 +373,7 @@ EfiHttpRequest (
|
||||||
if (HttpInstance->RemoteHost != NULL) {
|
if (HttpInstance->RemoteHost != NULL) {
|
||||||
FreePool (HttpInstance->RemoteHost);
|
FreePool (HttpInstance->RemoteHost);
|
||||||
HttpInstance->RemoteHost = NULL;
|
HttpInstance->RemoteHost = NULL;
|
||||||
|
HttpInstance->RemotePort = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue