Skip to content

Commit e7db223

Browse files
committed
SerializableExpressions: Mark GetObjectData as SecurityCritical
1 parent bd340f2 commit e7db223

20 files changed

+100
-72
lines changed

Orm/Xtensive.Orm/Linq/SerializableExpressions/SerializableBinaryExpression.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
// Copyright (C) 2003-2010 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
1+
// Copyright (C) 2009-2021 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
44
// Created by: Denis Krjuchkov
55
// Created: 2009.05.12
66

77
using System;
88
using System.Linq.Expressions;
99
using System.Reflection;
1010
using System.Runtime.Serialization;
11+
using System.Security;
1112
using Xtensive.Linq.SerializableExpressions.Internals;
1213

1314
namespace Xtensive.Linq.SerializableExpressions
@@ -33,9 +34,9 @@ public sealed class SerializableBinaryExpression : SerializableExpression
3334
/// <summary>
3435
/// <see cref="BinaryExpression.Method"/>
3536
/// </summary>
36-
[NonSerialized]
3737
public MethodInfo Method;
3838

39+
[SecurityCritical]
3940
public override void GetObjectData(SerializationInfo info, StreamingContext context)
4041
{
4142
base.GetObjectData(info, context);

Orm/Xtensive.Orm/Linq/SerializableExpressions/SerializableConditionalExpression.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
// Copyright (C) 2003-2010 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
1+
// Copyright (C) 2009-2021 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
44
// Created by: Denis Krjuchkov
55
// Created: 2009.05.12
66

77
using System;
88
using System.Linq.Expressions;
99
using System.Runtime.Serialization;
10+
using System.Security;
1011

1112
namespace Xtensive.Linq.SerializableExpressions
1213
{
@@ -29,6 +30,7 @@ public sealed class SerializableConditionalExpression : SerializableExpression
2930
/// </summary>
3031
public SerializableExpression IfFalse;
3132

33+
[SecurityCritical]
3234
public override void GetObjectData(SerializationInfo info, StreamingContext context)
3335
{
3436
base.GetObjectData(info, context);

Orm/Xtensive.Orm/Linq/SerializableExpressions/SerializableConstantExpression.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
// Copyright (C) 2003-2010 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
1+
// Copyright (C) 2009-2021 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
44
// Created by: Denis Krjuchkov
55
// Created: 2009.05.12
66

77
using System;
88
using System.Linq.Expressions;
99
using System.Runtime.Serialization;
10+
using System.Security;
1011

1112
namespace Xtensive.Linq.SerializableExpressions
1213
{
@@ -21,6 +22,7 @@ public sealed class SerializableConstantExpression : SerializableExpression
2122
/// </summary>
2223
public object Value;
2324

25+
[SecurityCritical]
2426
public override void GetObjectData(SerializationInfo info, StreamingContext context)
2527
{
2628
base.GetObjectData(info, context);

Orm/Xtensive.Orm/Linq/SerializableExpressions/SerializableElementInit.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
// Copyright (C) 2003-2010 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
1+
// Copyright (C) 2009-2021 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
44
// Created by: Denis Kryuchkov
55
// Created: 2009.05.14
66

77
using System;
88
using System.Linq.Expressions;
99
using System.Reflection;
1010
using System.Runtime.Serialization;
11+
using System.Security;
1112
using Xtensive.Linq.SerializableExpressions.Internals;
1213

1314
namespace Xtensive.Linq.SerializableExpressions
@@ -21,13 +22,13 @@ public sealed class SerializableElementInit : ISerializable
2122
/// <summary>
2223
/// <see cref="ElementInit.AddMethod"/>
2324
/// </summary>
24-
[NonSerialized]
2525
public MethodInfo AddMethod;
2626
/// <summary>
2727
/// <see cref="ElementInit.Arguments"/>
2828
/// </summary>
2929
public SerializableExpression[] Arguments;
3030

31+
[SecurityCritical]
3132
public void GetObjectData(SerializationInfo info, StreamingContext context)
3233
{
3334
info.AddValue("AddMethod", AddMethod.ToSerializableForm());

Orm/Xtensive.Orm/Linq/SerializableExpressions/SerializableExpression.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
// Copyright (C) 2003-2010 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
1+
// Copyright (C) 2009-2021 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
44
// Created by: Denis Krjuchkov
55
// Created: 2009.05.12
66

77
using System;
88
using System.Linq.Expressions;
99
using System.Runtime.Serialization;
10+
using System.Security;
1011
using Xtensive.Linq.SerializableExpressions.Internals;
1112

1213
namespace Xtensive.Linq.SerializableExpressions
@@ -24,9 +25,9 @@ public abstract class SerializableExpression : ISerializable
2425
/// <summary>
2526
/// <see cref="Expression.Type"/>.
2627
/// </summary>
27-
[NonSerialized]
2828
public Type Type;
2929

30+
[SecurityCritical]
3031
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
3132
{
3233
info.AddValue("NodeType", NodeType.ToString());

Orm/Xtensive.Orm/Linq/SerializableExpressions/SerializableInvocationExpression.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
// Copyright (C) 2003-2010 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
1+
// Copyright (C) 2009-2021 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
44
// Created by: Denis Krjuchkov
55
// Created: 2009.05.13
66

77
using System;
88
using System.Linq.Expressions;
99
using System.Runtime.Serialization;
10+
using System.Security;
1011
using Xtensive.Linq.SerializableExpressions.Internals;
1112

1213
namespace Xtensive.Linq.SerializableExpressions
@@ -26,6 +27,7 @@ public sealed class SerializableInvocationExpression : SerializableExpression
2627
/// </summary>
2728
public SerializableExpression[] Arguments;
2829

30+
[SecurityCritical]
2931
public override void GetObjectData(SerializationInfo info, StreamingContext context)
3032
{
3133
base.GetObjectData(info, context);

Orm/Xtensive.Orm/Linq/SerializableExpressions/SerializableLambdaExpression.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
// Copyright (C) 2003-2010 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
1+
// Copyright (C) 2009-2021 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
44
// Created by: Denis Krjuchkov
55
// Created: 2009.05.12
66

77
using System;
88
using System.Linq.Expressions;
99
using System.Runtime.Serialization;
10+
using System.Security;
1011
using Xtensive.Linq.SerializableExpressions.Internals;
1112

1213
namespace Xtensive.Linq.SerializableExpressions
@@ -27,6 +28,7 @@ public sealed class SerializableLambdaExpression : SerializableExpression
2728
/// </summary>
2829
public SerializableParameterExpression[] Parameters;
2930

31+
[SecurityCritical]
3032
public override void GetObjectData(SerializationInfo info, StreamingContext context)
3133
{
3234
base.GetObjectData(info, context);

Orm/Xtensive.Orm/Linq/SerializableExpressions/SerializableListInitExpression.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
// Copyright (C) 2003-2010 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
1+
// Copyright (C) 2009-2021 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
44
// Created by: Denis Krjuchkov
55
// Created: 2009.05.13
66

77
using System;
88
using System.Linq.Expressions;
99
using System.Runtime.Serialization;
10+
using System.Security;
1011
using Xtensive.Linq.SerializableExpressions.Internals;
1112

1213
namespace Xtensive.Linq.SerializableExpressions
@@ -26,6 +27,7 @@ public sealed class SerializableListInitExpression : SerializableExpression
2627
/// </summary>
2728
public SerializableElementInit[] Initializers;
2829

30+
[SecurityCritical]
2931
public override void GetObjectData(SerializationInfo info, StreamingContext context)
3032
{
3133
base.GetObjectData(info, context);

Orm/Xtensive.Orm/Linq/SerializableExpressions/SerializableMemberAssignment.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
// Copyright (C) 2003-2010 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
1+
// Copyright (C) 2009-2021 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
44
// Created by: Denis Krjuchkov
55
// Created: 2009.05.15
66

77
using System;
88
using System.Linq.Expressions;
99
using System.Runtime.Serialization;
10+
using System.Security;
1011

1112
namespace Xtensive.Linq.SerializableExpressions
1213
{
@@ -21,6 +22,7 @@ public class SerializableMemberAssignment : SerializableMemberBinding
2122
/// </summary>
2223
public SerializableExpression Expression;
2324

25+
[SecurityCritical]
2426
public override void GetObjectData(SerializationInfo info, StreamingContext context)
2527
{
2628
base.GetObjectData(info, context);

Orm/Xtensive.Orm/Linq/SerializableExpressions/SerializableMemberBinding.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
// Copyright (C) 2003-2010 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
1+
// Copyright (C) 2009-2021 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
44
// Created by: Denis Krjuchkov
55
// Created: 2009.05.15
66

77
using System;
88
using System.Linq.Expressions;
99
using System.Reflection;
1010
using System.Runtime.Serialization;
11+
using System.Security;
1112
using Xtensive.Linq.SerializableExpressions.Internals;
1213

1314
namespace Xtensive.Linq.SerializableExpressions
@@ -25,9 +26,9 @@ public abstract class SerializableMemberBinding : ISerializable
2526
/// <summary>
2627
/// <see cref="MemberBinding.Member"/>
2728
/// </summary>
28-
[NonSerialized]
2929
public MemberInfo Member;
3030

31+
[SecurityCritical]
3132
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
3233
{
3334
info.AddValue("Member", Member.ToSerializableForm());

0 commit comments

Comments
 (0)