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>
This commit is contained in:
@@ -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.
|
||||
//
|
||||
|
Reference in New Issue
Block a user