NetworkPkg: Add assert for buffer pointer from DHCP driver.
The PxeBcDhcp4CallBack() is provided for DHCP driver to invoke packet check during DHCP process, the DHCP driver should make sure Packet and NewPacket has meaningful value. This patch adds assert for this. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
This commit is contained in:
@@ -1210,6 +1210,8 @@ PxeBcDhcp4CallBack (
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ASSERT (Packet != NULL);
|
||||||
|
|
||||||
Private = (PXEBC_PRIVATE_DATA *) Context;
|
Private = (PXEBC_PRIVATE_DATA *) Context;
|
||||||
Mode = Private->PxeBc.Mode;
|
Mode = Private->PxeBc.Mode;
|
||||||
Callback = Private->PxeBcCallback;
|
Callback = Private->PxeBcCallback;
|
||||||
@@ -1305,6 +1307,8 @@ PxeBcDhcp4CallBack (
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Dhcp4SelectOffer:
|
case Dhcp4SelectOffer:
|
||||||
|
ASSERT (NewPacket != NULL);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Select offer by the default policy or by order, and record the SelectIndex
|
// Select offer by the default policy or by order, and record the SelectIndex
|
||||||
// and SelectProxyType.
|
// and SelectProxyType.
|
||||||
|
Reference in New Issue
Block a user