mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 15:44:04 +02:00
NetworkPkg: Check for NULL pointer before dereference it.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
This commit is contained in:
parent
e86f363564
commit
b340056060
@ -2013,8 +2013,12 @@ EfiPxeBcSetStationIP (
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (!Mode->UsingIpv6 && NewStationIp != NULL && !NetIp4IsUnicast (NTOHL (NewStationIp->Addr[0]), NTOHL (NewSubnetMask->Addr[0]))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
if (!Mode->UsingIpv6 && NewStationIp != NULL) {
|
||||
if (IP4_IS_UNSPECIFIED(NTOHL (NewStationIp->Addr[0])) ||
|
||||
IP4_IS_LOCAL_BROADCAST(NTOHL (NewStationIp->Addr[0])) ||
|
||||
(NewSubnetMask != NULL && !NetIp4IsUnicast (NTOHL (NewStationIp->Addr[0]), NTOHL (NewSubnetMask->Addr[0])))) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Mode->Started) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user