mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
NetworkPkg/Dhcp6Dxe: Defensively check for NULL Config in Dhcp6UpdateIaInfo
Replace the ASSERT (Instance->Config != NULL) in Dhcp6UpdateIaInfo with an explicit NULL check that returns EFI_DEVICE_ERROR. Also add a complementary guard in Dhcp6GenerateIaCb alongside the existing check for Instance->IaCb.Ia. These are defensive changes to prevent potential NULL pointer dereferences. Signed-off-by: Abuthahir M <abuthahirm@ami.com>
This commit is contained in:
parent
0f07c187d0
commit
bc15a87b74
2 changed files with 4 additions and 2 deletions
|
|
@ -538,7 +538,9 @@ Dhcp6UpdateIaInfo (
|
|||
T1 = 0;
|
||||
T2 = 0;
|
||||
|
||||
ASSERT (Instance->Config != NULL);
|
||||
if (Instance->Config == NULL) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
// OptionLen is the length of the Options excluding the DHCP header.
|
||||
// Length of the EFI_DHCP6_PACKET from the first byte of the Header field to the last
|
||||
|
|
|
|||
|
|
@ -1335,7 +1335,7 @@ Dhcp6GenerateIaCb (
|
|||
UINT32 IaSize;
|
||||
EFI_DHCP6_IA *Ia;
|
||||
|
||||
if (Instance->IaCb.Ia == NULL) {
|
||||
if ((Instance->IaCb.Ia == NULL) || (Instance->Config == NULL)) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue