diff --git a/AdvLoggerPkg/Library/AssertLib/AssertLib.c b/AdvLoggerPkg/Library/AssertLib/AssertLib.c index 8304862958..640e6ec9ae 100644 --- a/AdvLoggerPkg/Library/AssertLib/AssertLib.c +++ b/AdvLoggerPkg/Library/AssertLib/AssertLib.c @@ -63,7 +63,7 @@ DebugAssert ( // // Send the print string to the Logging device device // - AdvancedLoggerWrite (DEBUG_ERROR, Buffer, AsciiStrLen (Buffer)); + AdvancedLoggerWrite (DEBUG_ERROR, Buffer, AsciiStrnLenS (Buffer, sizeof (Buffer))); if ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) { CpuBreakpoint (); diff --git a/AdvLoggerPkg/Library/AssertTelemetryLib/AssertLib.c b/AdvLoggerPkg/Library/AssertTelemetryLib/AssertLib.c index 0517cf2600..e6f262c22b 100644 --- a/AdvLoggerPkg/Library/AssertTelemetryLib/AssertLib.c +++ b/AdvLoggerPkg/Library/AssertTelemetryLib/AssertLib.c @@ -71,9 +71,9 @@ DebugAssert ( // Check to make sure the file name is valid and at least two characters long (which would be just the extension) if ((FileName != NULL) && - (AsciiStrLen (FileName) >= 2)) + (AsciiStrnLenS (FileName, sizeof (Buffer)) >= 2)) { - FileNameLength = AsciiStrLen (FileName) - (2 * sizeof (CHAR8)); // We don't care about the extension + FileNameLength = AsciiStrnLenS (FileName, sizeof (Buffer)) - (2 * sizeof (CHAR8)); // We don't care about the extension } // END LOGTELEMETRY @@ -86,7 +86,7 @@ DebugAssert ( // // Send the print string to the Logging device device // - AdvancedLoggerWrite (DEBUG_ERROR, Buffer, AsciiStrLen (Buffer)); + AdvancedLoggerWrite (DEBUG_ERROR, Buffer, AsciiStrnLenS (Buffer, sizeof (Buffer))); // // Generate a Breakpoint, DeadLoop, or Telemetry based on PCD settings diff --git a/AdvLoggerPkg/Library/BaseDebugLibAdvancedLogger/DebugLib.c b/AdvLoggerPkg/Library/BaseDebugLibAdvancedLogger/DebugLib.c index 366f008aad..1d3287c445 100644 --- a/AdvLoggerPkg/Library/BaseDebugLibAdvancedLogger/DebugLib.c +++ b/AdvLoggerPkg/Library/BaseDebugLibAdvancedLogger/DebugLib.c @@ -171,7 +171,7 @@ DebugPrintMarker ( // // Send the print string to the Advanced Logger // - AdvancedLoggerWrite (ErrorLevel, Buffer, AsciiStrLen (Buffer)); + AdvancedLoggerWrite (ErrorLevel, Buffer, AsciiStrnLenS (Buffer, sizeof (Buffer))); } /**