From e41460573308bf411b6c591f25667c1503119180 Mon Sep 17 00:00:00 2001 From: iadgovuser58 <124906646+iadgovuser58@users.noreply.github.com> Date: Tue, 9 Jul 2024 13:54:41 -0400 Subject: [PATCH] fixed check of class code list --- .../events/DeviceSecurityEventDataPciContext.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventDataPciContext.java b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventDataPciContext.java index 8684b60f..4f16a1e5 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventDataPciContext.java +++ b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventDataPciContext.java @@ -120,10 +120,14 @@ public class DeviceSecurityEventDataPciContext extends DeviceSecurityEventDataDe dSEDpciContextInfo += "\n RevisionID = " + revisionId; List classCodeList = translateDeviceClass(classCode); - dSEDpciContextInfo += "\n Device Class:"; - dSEDpciContextInfo += "\n Class = " + classCodeList.get(0); - dSEDpciContextInfo += "\n Subclass = " + classCodeList.get(1); - dSEDpciContextInfo += "\n Programming Interface = " + classCodeList.get(2); + dSEDpciContextInfo += "\n Device Class: "; + if(classCodeList.size() == 3) { + dSEDpciContextInfo += "\n Class = " + classCodeList.get(0); + dSEDpciContextInfo += "\n Subclass = " + classCodeList.get(1); + dSEDpciContextInfo += "\n Programming Interface = " + classCodeList.get(2); + } else { + dSEDpciContextInfo += " ** Class code could not be determined **"; + } dSEDpciContextInfo += "\n SubsystemVendor = " + translateVendor(subsystemVendorId); dSEDpciContextInfo += "\n Subsystem = " + translateDevice(subsystemVendorId, subsystemId);