summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/HttpDxe/HttpProto.c
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2016-12-23 11:13:21 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2016-12-26 16:56:14 +0800
commit63f1d6a4c0f5df43e7c77041087754ddd169dea8 (patch)
tree33a619731bc6117a18254a4b72f7c35a8bbcbc99 /NetworkPkg/HttpDxe/HttpProto.c
parent0e5e7996c9366fd6f710963c6a414003fd5a95ec (diff)
downloadedk2-63f1d6a4c0f5df43e7c77041087754ddd169dea8.tar.gz
edk2-63f1d6a4c0f5df43e7c77041087754ddd169dea8.tar.bz2
edk2-63f1d6a4c0f5df43e7c77041087754ddd169dea8.zip
NetworkPkg/HttpDxe: Fix the potential NULL dereference
Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Wu Hao A <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
Diffstat (limited to 'NetworkPkg/HttpDxe/HttpProto.c')
-rw-r--r--NetworkPkg/HttpDxe/HttpProto.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c
index 36c61e2e99..199d575cf9 100644
--- a/NetworkPkg/HttpDxe/HttpProto.c
+++ b/NetworkPkg/HttpDxe/HttpProto.c
@@ -1655,6 +1655,8 @@ HttpTcpTransmit (
UINTN UrlSize;
UINTN RequestMsgSize;
+ RequestMsg = NULL;
+
ValueInItem = (HTTP_TOKEN_WRAP *) Item->Value;
if (ValueInItem->TcpWrap.IsTxDone) {
return EFI_SUCCESS;
@@ -1682,10 +1684,12 @@ HttpTcpTransmit (
);
FreePool (Url);
- if (EFI_ERROR (Status)){
+ if (EFI_ERROR (Status) || NULL == RequestMsg){
return Status;
}
+ ASSERT (RequestMsg != NULL);
+
//
// Transmit the request message.
//