diff options
author | tye <tye@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-01-11 10:56:53 +0000 |
---|---|---|
committer | tye <tye@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-01-11 10:56:53 +0000 |
commit | 70b689905c0ea1c9782f45dcce66f37986e886d9 (patch) | |
tree | a09574c36d0f28bb6d011b213c4fc6e5d4a877cb /MdeModulePkg | |
parent | 77a725127cbb1de5c06a72fc579ffab4b1884d36 (diff) | |
download | edk2-70b689905c0ea1c9782f45dcce66f37986e886d9.tar.gz edk2-70b689905c0ea1c9782f45dcce66f37986e886d9.tar.bz2 edk2-70b689905c0ea1c9782f45dcce66f37986e886d9.zip |
Add ASSERT () to make sure the array is accessed within the limit.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9709 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c index e18f4ab474..485c09f963 100644 --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c @@ -375,6 +375,7 @@ SyslogBuildPacket ( //
Pri = ((NET_SYSLOG_FACILITY & 31) << 3) | (Level & 7);
gRT->GetTime (&Time, NULL);
+ ASSERT (Time.Month <= 12);
//
// Use %a to format the ASCII strings, %s to format UNICODE strings
@@ -783,7 +784,7 @@ NetIp6IsNetEqual ( UINT8 Bit;
UINT8 Mask;
- ASSERT (Ip1 != NULL && Ip2 != NULL);
+ ASSERT ((Ip1 != NULL) && (Ip2 != NULL) && (PrefixLength < IP6_PREFIX_NUM));
if (PrefixLength == 0) {
return TRUE;
@@ -799,6 +800,7 @@ NetIp6IsNetEqual ( if (Bit > 0) {
Mask = (UINT8) (0xFF << (8 - Bit));
+ ASSERT (Byte < 16);
if ((Ip1->Addr[Byte] & Mask) != (Ip2->Addr[Byte] & Mask)) {
return FALSE;
}
@@ -2183,10 +2185,10 @@ NetLibDefaultAddressIsStatic ( IsStatic = TRUE;
Status = gBS->LocateProtocol (
- &gEfiHiiConfigRoutingProtocolGuid,
- NULL,
- (VOID **) &HiiConfigRouting
- );
+ &gEfiHiiConfigRoutingProtocolGuid,
+ NULL,
+ (VOID **) &HiiConfigRouting
+ );
if (EFI_ERROR (Status)) {
return TRUE;
}
|