Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added codeql fixes to DxeCorePerformanceLib.c #636

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,13 @@ InsertFpdtRecord (
switch (PerfId) {
case MODULE_START_ID:
case MODULE_END_ID:
GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
// MU_CHANGE [BEGIN] - CodeQL change
Status = GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
makubacki marked this conversation as resolved.
Show resolved Hide resolved
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "Failed to get Module Info from Handle! Status = %r\n", Status));
}

// MU_CHANGE [END] - CodeQL change
StringPtr = ModuleName;
//
// Cache the offset of start image start record and use to update the start image end record if needed.
Expand Down Expand Up @@ -1083,7 +1089,13 @@ InsertFpdtRecord (

case MODULE_LOADIMAGE_START_ID:
case MODULE_LOADIMAGE_END_ID:
GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
// MU_CHANGE [BEGIN] - CodeQL change
Status = GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "Failed to get Module Info from Handle! Status = %r\n", Status));
}

// MU_CHANGE [END] - CodeQL change
StringPtr = ModuleName;
if (PerfId == MODULE_LOADIMAGE_START_ID) {
mLoadImageCount++;
Expand Down Expand Up @@ -1126,7 +1138,13 @@ InsertFpdtRecord (
case MODULE_DB_SUPPORT_END_ID:
case MODULE_DB_STOP_START_ID:
case MODULE_DB_STOP_END_ID:
GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
// MU_CHANGE [BEGIN] - CodeQL change
Status = GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "Failed to get Module Info from Handle! Status = %r\n", Status));
}

// MU_CHANGE [END] - CodeQL change
StringPtr = ModuleName;
if (!PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) {
FpdtRecordPtr.GuidQwordEvent->Header.Type = FPDT_GUID_QWORD_EVENT_TYPE;
Expand All @@ -1141,7 +1159,13 @@ InsertFpdtRecord (
break;

case MODULE_DB_END_ID:
GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
// MU_CHANGE [BEGIN] - CodeQL change
Status = GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "Failed to get Module Info from Handle! Status = %r\n", Status));
}

// MU_CHANGE [END] - CodeQL change
StringPtr = ModuleName;
if (!PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) {
FpdtRecordPtr.GuidQwordStringEvent->Header.Type = FPDT_GUID_QWORD_STRING_EVENT_TYPE;
Expand Down