summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/Ip4Dxe
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2014-06-26 03:24:25 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2014-06-26 03:24:25 +0000
commit523f48e771b1088c6e2cfddc5c56cde1ef9a2ab0 (patch)
tree91d3cdacf538e40a24922981037cd413af4f6123 /MdeModulePkg/Universal/Network/Ip4Dxe
parentd0f65b21c58b958ba370e774c6fe3ddc5ff1f3c7 (diff)
downloadedk2-523f48e771b1088c6e2cfddc5c56cde1ef9a2ab0.zip
edk2-523f48e771b1088c6e2cfddc5c56cde1ef9a2ab0.tar.gz
edk2-523f48e771b1088c6e2cfddc5c56cde1ef9a2ab0.tar.bz2
Refine code to make it more safely.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15598 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/Ip4Dxe')
-rw-r--r--MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
index e4ab17a..3c29f75 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4If.c
@@ -1,7 +1,7 @@
/** @file
Implement IP4 pesudo interface.
-Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2014, 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
which accompanies this distribution. The full text of the license may be found at
@@ -582,6 +582,7 @@ Ip4SetAddress (
Type = NetGetIpClass (IpAddr);
Len = NetGetMaskLength (SubnetMask);
+ ASSERT (Len >= 1);
Netmask = gIp4AllMasks[MIN ((Len - 1), Type << 3)];
Interface->NetBrdcast = (IpAddr | ~Netmask);