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
This commit is contained in:
@ -375,6 +375,7 @@ SyslogBuildPacket (
|
|||||||
//
|
//
|
||||||
Pri = ((NET_SYSLOG_FACILITY & 31) << 3) | (Level & 7);
|
Pri = ((NET_SYSLOG_FACILITY & 31) << 3) | (Level & 7);
|
||||||
gRT->GetTime (&Time, NULL);
|
gRT->GetTime (&Time, NULL);
|
||||||
|
ASSERT (Time.Month <= 12);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Use %a to format the ASCII strings, %s to format UNICODE strings
|
// Use %a to format the ASCII strings, %s to format UNICODE strings
|
||||||
@ -783,7 +784,7 @@ NetIp6IsNetEqual (
|
|||||||
UINT8 Bit;
|
UINT8 Bit;
|
||||||
UINT8 Mask;
|
UINT8 Mask;
|
||||||
|
|
||||||
ASSERT (Ip1 != NULL && Ip2 != NULL);
|
ASSERT ((Ip1 != NULL) && (Ip2 != NULL) && (PrefixLength < IP6_PREFIX_NUM));
|
||||||
|
|
||||||
if (PrefixLength == 0) {
|
if (PrefixLength == 0) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -799,6 +800,7 @@ NetIp6IsNetEqual (
|
|||||||
if (Bit > 0) {
|
if (Bit > 0) {
|
||||||
Mask = (UINT8) (0xFF << (8 - Bit));
|
Mask = (UINT8) (0xFF << (8 - Bit));
|
||||||
|
|
||||||
|
ASSERT (Byte < 16);
|
||||||
if ((Ip1->Addr[Byte] & Mask) != (Ip2->Addr[Byte] & Mask)) {
|
if ((Ip1->Addr[Byte] & Mask) != (Ip2->Addr[Byte] & Mask)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -2183,10 +2185,10 @@ NetLibDefaultAddressIsStatic (
|
|||||||
IsStatic = TRUE;
|
IsStatic = TRUE;
|
||||||
|
|
||||||
Status = gBS->LocateProtocol (
|
Status = gBS->LocateProtocol (
|
||||||
&gEfiHiiConfigRoutingProtocolGuid,
|
&gEfiHiiConfigRoutingProtocolGuid,
|
||||||
NULL,
|
NULL,
|
||||||
(VOID **) &HiiConfigRouting
|
(VOID **) &HiiConfigRouting
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user