diff --git a/src/Shared/HttpSys/RequestProcessing/PathNormalizer.cs b/src/Shared/HttpSys/RequestProcessing/PathNormalizer.cs index f92066f310..f6a0159ff5 100644 --- a/src/Shared/HttpSys/RequestProcessing/PathNormalizer.cs +++ b/src/Shared/HttpSys/RequestProcessing/PathNormalizer.cs @@ -3,6 +3,8 @@ using System; using System.Diagnostics; +using System.Runtime.InteropServices; + namespace Microsoft.AspNetCore.HttpSys.Internal { internal static class PathNormalizer @@ -13,7 +15,7 @@ namespace Microsoft.AspNetCore.HttpSys.Internal // In-place implementation of the algorithm from https://tools.ietf.org/html/rfc3986#section-5.2.4 public static unsafe int RemoveDotSegments(Span input) { - fixed (byte* start = input) + fixed (byte* start = &MemoryMarshal.GetReference(input)) { var end = start + input.Length; return RemoveDotSegments(start, end);