diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs index 8700c8bd52c53b..c1a7b7ee40c85e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs @@ -464,6 +464,7 @@ private static unsafe int AddIdToGuid(Guid* outPtr, int whereToAddId, uint id, b { // Indicate this is a 1 byte multicode with 4 high order bits in the lower nibble. *ptr = (byte)(((uint)NumberListCodes.MultiByte1 << 4) + (id >> 8)); + len--; // The id's 4 high order bits were written into the multicode byte, so update the length. id &= 0xFF; // Now we only want the low order bits. } ptr++;