| File: System\Reflection\Metadata\TypeNameParseOptions.cs | Web Access |
| Project: src\runtime\src\libraries\System.Reflection.Metadata\src\System.Reflection.Metadata.csproj (System.Reflection.Metadata) |
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace System.Reflection.Metadata { public sealed class TypeNameParseOptions { private int _maxNodes = 20; /// <summary> /// Limits the maximum value of <seealso cref="TypeName.GetNodeCount">node count</seealso> that parser can handle. /// </summary> /// <remarks> /// <para> /// Setting this to a large value can render <see cref="TypeName"/> susceptible to Denial of Service /// attacks when parsing or handling malicious input. /// </para> /// <para>The default value is 20.</para> /// </remarks> public int MaxNodes { get => _maxNodes; set { ArgumentOutOfRangeException.ThrowIfLessThanOrEqual(value, 0, nameof(value)); _maxNodes = value; } } } }