Skip to content

Commit

Permalink
Fix wrong security attributes on YamlException
Browse files Browse the repository at this point in the history
  • Loading branch information
aaubry committed May 16, 2018
1 parent 113261c commit be468bf
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions YamlDotNet/Core/YamlException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
// SOFTWARE.

using System;
using System.Runtime.Serialization;

namespace YamlDotNet.Core
{
Expand Down Expand Up @@ -83,39 +82,5 @@ public YamlException(string message, Exception inner)
: base(message, inner)
{
}

#if !(NETSTANDARD1_3 || UNITY)
/// <summary>
/// Initializes a new instance of the <see cref="YamlException"/> class.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info"/> parameter is null. </exception>
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0). </exception>
protected YamlException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
Start = (Mark)info.GetValue("Start", typeof(Mark));
End = (Mark)info.GetValue("End", typeof(Mark));
}

/// <summary>
/// When overridden in a derived class, sets the <see cref="T:System.Runtime.Serialization.SerializationInfo"/> with information about the exception.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info"/> parameter is a null reference (Nothing in Visual Basic). </exception>
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Read="*AllFiles*" PathDiscovery="*AllFiles*"/>
/// <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="SerializationFormatter"/>
/// </PermissionSet>
[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.LinkDemand, Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
info.AddValue("Start", Start);
info.AddValue("End", End);
}
#endif
}
}

0 comments on commit be468bf

Please sign in to comment.