summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/TcpDxe
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2017-03-21 11:36:31 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2017-03-23 11:39:31 +0800
commitba0252808b2d0a0362d6bcd9ddef6cd3d2e3bca3 (patch)
treecb6571d5b940fe788324a579d5888e3e7a9e8d51 /NetworkPkg/TcpDxe
parentd0e76ac5ce07eb116f8cbea90b7f373d0c127a78 (diff)
downloadedk2-ba0252808b2d0a0362d6bcd9ddef6cd3d2e3bca3.tar.gz
edk2-ba0252808b2d0a0362d6bcd9ddef6cd3d2e3bca3.tar.bz2
edk2-ba0252808b2d0a0362d6bcd9ddef6cd3d2e3bca3.zip
NetworkPkg: Fix potential ASSERT if NetIp4IsUnicast is called
Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: Subramanian Sriram <sriram-s@hpe.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Diffstat (limited to 'NetworkPkg/TcpDxe')
-rw-r--r--NetworkPkg/TcpDxe/TcpMain.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/NetworkPkg/TcpDxe/TcpMain.c b/NetworkPkg/TcpDxe/TcpMain.c
index 03942ee32e..fc3713e533 100644
--- a/NetworkPkg/TcpDxe/TcpMain.c
+++ b/NetworkPkg/TcpDxe/TcpMain.c
@@ -2,7 +2,7 @@
Implementation of EFI_TCP4_PROTOCOL and EFI_TCP6_PROTOCOL.
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -159,7 +159,8 @@ Tcp4Configure (
CopyMem (&Ip, &TcpConfigData->AccessPoint.StationAddress, sizeof (IP4_ADDR));
CopyMem (&SubnetMask, &TcpConfigData->AccessPoint.SubnetMask, sizeof (IP4_ADDR));
- if (!IP4_IS_VALID_NETMASK (NTOHL (SubnetMask)) || !NetIp4IsUnicast (NTOHL (Ip), NTOHL (SubnetMask))) {
+ if (!IP4_IS_VALID_NETMASK (NTOHL (SubnetMask)) ||
+ (SubnetMask != 0 && !NetIp4IsUnicast (NTOHL (Ip), NTOHL (SubnetMask)))) {
return EFI_INVALID_PARAMETER;
}
}