diff options
author | fanwang2 <fan.wang@intel.com> | 2015-07-10 09:00:33 +0000 |
---|---|---|
committer | fanwang2 <fanwang2@Edk2> | 2015-07-10 09:00:33 +0000 |
commit | 3fd7bd08f438130f9fcbcc1ab4392dea1a859c14 (patch) | |
tree | 2ac1c1d8cf921d06b14b56582542ae8ae4807473 /NetworkPkg/HttpDxe | |
parent | 6b6fe3e9aa3d27070cf8e004a194a9c6f392ba5b (diff) | |
download | edk2-platforms-3fd7bd08f438130f9fcbcc1ab4392dea1a859c14.tar.xz |
NetworkPkg: Code logic optimization for DnsDxe and HttpDxe driver
Revise some errors which may lead NULL pointer be dereferenced:
* DnsDhcp.c: Paralist may be used without any initialized
* DnsHeader and RcvString may be null but be dereferenced
* HttpDriver.c: revise an if judgment
* HttpImpl.c: add a judgment to avoid null dereferenced
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: fanwang2 <fan.wang@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17923 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg/HttpDxe')
-rw-r--r-- | NetworkPkg/HttpDxe/HttpDriver.c | 2 | ||||
-rw-r--r-- | NetworkPkg/HttpDxe/HttpImpl.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/NetworkPkg/HttpDxe/HttpDriver.c b/NetworkPkg/HttpDxe/HttpDriver.c index b65607a4cb..43f42e29bf 100644 --- a/NetworkPkg/HttpDxe/HttpDriver.c +++ b/NetworkPkg/HttpDxe/HttpDriver.c @@ -79,7 +79,7 @@ HttpCleanService ( IN HTTP_SERVICE *HttpService
)
{
- if (HttpService != NULL) {
+ if (HttpService == NULL) {
return ;
}
diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index 4bd4ac884f..545fe42332 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.c +++ b/NetworkPkg/HttpDxe/HttpImpl.c @@ -766,6 +766,10 @@ HttpResponseWorker ( HTTP_TOKEN_WRAP *ValueInItem;
UINTN HdrLen;
+ if (Wrap == NULL || Wrap->HttpInstance == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
HttpInstance = Wrap->HttpInstance;
Token = Wrap->HttpToken;
|