diff options
7 files changed, 28 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c index bec8ce7..f7a7d7f 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c @@ -341,6 +341,7 @@ FindStringBlock ( for (Index = 0; Index < StringCount; Index++) {
BlockSize += AsciiStrSize ((CHAR8 *) StringTextPtr);
if (CurrentStringId == StringId) {
+ ASSERT (BlockType != NULL && StringBlockAddr != NULL && StringTextOffset != NULL);
*BlockType = *BlockHdr;
*StringBlockAddr = BlockHdr;
*StringTextOffset = StringTextPtr - BlockHdr;
@@ -363,6 +364,7 @@ FindStringBlock ( for (Index = 0; Index < StringCount; Index++) {
BlockSize += AsciiStrSize ((CHAR8 *) StringTextPtr);
if (CurrentStringId == StringId) {
+ ASSERT (BlockType != NULL && StringBlockAddr != NULL && StringTextOffset != NULL);
*BlockType = *BlockHdr;
*StringBlockAddr = BlockHdr;
*StringTextOffset = StringTextPtr - BlockHdr;
@@ -406,6 +408,7 @@ FindStringBlock ( GetUnicodeStringTextOrSize (NULL, StringTextPtr, &StringSize);
BlockSize += StringSize;
if (CurrentStringId == StringId) {
+ ASSERT (BlockType != NULL && StringBlockAddr != NULL && StringTextOffset != NULL);
*BlockType = *BlockHdr;
*StringBlockAddr = BlockHdr;
*StringTextOffset = StringTextPtr - BlockHdr;
@@ -429,6 +432,7 @@ FindStringBlock ( GetUnicodeStringTextOrSize (NULL, StringTextPtr, &StringSize);
BlockSize += StringSize;
if (CurrentStringId == StringId) {
+ ASSERT (BlockType != NULL && StringBlockAddr != NULL && StringTextOffset != NULL);
*BlockType = *BlockHdr;
*StringBlockAddr = BlockHdr;
*StringTextOffset = StringTextPtr - BlockHdr;
@@ -572,7 +576,7 @@ FindStringBlock ( //
// Get last string ID
//
- if (StringId == (EFI_STRING_ID) (-1)) {
+ if (StringId == (EFI_STRING_ID) (-1) && LastStringId != NULL) {
*LastStringId = (EFI_STRING_ID) (CurrentStringId - 1);
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c b/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c index 8219e01..c754177 100644 --- a/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c +++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c @@ -533,6 +533,8 @@ ArpMatchAddress ( IN NET_ARP_ADDRESS *AddressTwo
)
{
+ ASSERT (AddressOne != NULL && AddressTwo != NULL);
+
if ((AddressOne->Type != AddressTwo->Type) ||
(AddressOne->Length != AddressTwo->Length)) {
//
diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c index 9cd1ae5..0990d18 100644 --- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c +++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Input.c @@ -419,7 +419,15 @@ Ip4Reassemble ( }
NewPacket->Ip.Ip4 = Assemble->Head;
- CopyMem (IP4_GET_CLIP_INFO (NewPacket), Assemble->Info, sizeof (*IP4_GET_CLIP_INFO (NewPacket)));
+
+ ASSERT (Assemble->Info != NULL);
+
+ CopyMem (
+ IP4_GET_CLIP_INFO (NewPacket),
+ Assemble->Info,
+ sizeof (*IP4_GET_CLIP_INFO (NewPacket))
+ );
+
return NewPacket;
}
@@ -1272,7 +1280,9 @@ Ip4InstanceDeliverPacket ( // headless. Trim the head off after copy. The IP head
// may be not continuous before the data.
//
- Head = NetbufAllocSpace (Dup, IP4_MAX_HEADLEN, NET_BUF_HEAD);
+ Head = NetbufAllocSpace (Dup, IP4_MAX_HEADLEN, NET_BUF_HEAD);
+ ASSERT (Head != NULL);
+
Dup->Ip.Ip4 = (IP4_HEAD *) Head;
CopyMem (Head, Packet->Ip.Ip4, Packet->Ip.Ip4->HeadLen << 2);
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c b/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c index c42a18e..2522d16 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/InputHandler.c @@ -1122,6 +1122,7 @@ GetSelectionInputPopUp ( Link = GetNextNode (&Question->OptionListHead, Link);
StringPtr = GetToken (OneOfOption->Text, MenuOption->Handle);
+ ASSERT (StringPtr != NULL);
//
// If the string occupies multiple lines, truncate it to fit in one line,
// and append a "..." for indication.
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c index 2fab5b7..c573fdb 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c @@ -533,6 +533,7 @@ DisplayForm ( if (!Suppress) {
StringPtr = GetToken (Statement->Prompt, Handle);
+ ASSERT (StringPtr != NULL);
Width = GetWidth (Statement, Handle);
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c b/MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c index 88a0590..f97d91a 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c @@ -502,6 +502,7 @@ ProcessOptions ( Character[0] = LEFT_ONEOF_DELIMITER;
NewStrCat (OptionString[0], Character);
StringPtr = GetToken (OneOfOption->Text, Selection->Handle);
+ ASSERT (StringPtr != NULL);
NewStrCat (OptionString[0], StringPtr);
Character[0] = RIGHT_ONEOF_DELIMITER;
NewStrCat (OptionString[0], Character);
@@ -599,6 +600,7 @@ ProcessOptions ( Character[0] = LEFT_ONEOF_DELIMITER;
NewStrCat (OptionString[0], Character);
StringPtr = GetToken (OneOfOption->Text, Selection->Handle);
+ ASSERT (StringPtr != NULL);
NewStrCat (OptionString[0], StringPtr);
Character[0] = RIGHT_ONEOF_DELIMITER;
NewStrCat (OptionString[0], Character);
diff --git a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c index d36254c..df42eda 100644 --- a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c +++ b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c @@ -1177,6 +1177,7 @@ EmuGetVariable ( VARIABLE_POINTER_TRACK Variable;
UINTN VarDataSize;
EFI_STATUS Status;
+ UINT8 *VariableDataPtr;
if (VariableName == NULL || VendorGuid == NULL || DataSize == NULL) {
return EFI_INVALID_PARAMETER;
@@ -1201,8 +1202,10 @@ EmuGetVariable ( Status = EFI_INVALID_PARAMETER;
goto Done;
}
-
- CopyMem (Data, GetVariableDataPtr (Variable.CurrPtr), VarDataSize);
+ VariableDataPtr = GetVariableDataPtr (Variable.CurrPtr);
+ ASSERT (VariableDataPtr != NULL);
+
+ CopyMem (Data, VariableDataPtr, VarDataSize);
if (Attributes != NULL) {
*Attributes = Variable.CurrPtr->Attributes;
}
|