From a72700006a0d5fb797bdc0d1d2bc0708556ebb09 Mon Sep 17 00:00:00 2001 From: Alexander Rose Date: Mon, 9 Mar 2020 18:17:23 +0100 Subject: [PATCH] fix stack overflow in equality comparer --- src/GraphQL.Primitives/GraphQLRequest.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/GraphQL.Primitives/GraphQLRequest.cs b/src/GraphQL.Primitives/GraphQLRequest.cs index ed351a10..c8931c90 100644 --- a/src/GraphQL.Primitives/GraphQLRequest.cs +++ b/src/GraphQL.Primitives/GraphQLRequest.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Runtime.Serialization; namespace GraphQL { @@ -64,7 +65,7 @@ public override bool Equals(object? obj) { public virtual bool Equals(GraphQLRequest? other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; - return EqualityComparer>.Default.Equals(this, other); + return this.Count == other.Count && !this.Except(other).Any(); } ///