From dc66295af16691455f8f44fd7e135d386e09b9c1 Mon Sep 17 00:00:00 2001 From: brentschmaltz Date: Wed, 15 Feb 2023 13:54:01 -0800 Subject: [PATCH] updated fix for controlling depth. --- .../json/Serialization/JsonSerializerInternalReader.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Microsoft.IdentityModel.Tokens/opensource/json/Serialization/JsonSerializerInternalReader.cs b/src/Microsoft.IdentityModel.Tokens/opensource/json/Serialization/JsonSerializerInternalReader.cs index 3b48c63fe6..36407b6c1f 100644 --- a/src/Microsoft.IdentityModel.Tokens/opensource/json/Serialization/JsonSerializerInternalReader.cs +++ b/src/Microsoft.IdentityModel.Tokens/opensource/json/Serialization/JsonSerializerInternalReader.cs @@ -1805,6 +1805,7 @@ private object CreateISerializable(JsonReader reader, JsonISerializableContract JsonConverter? itemConverter = GetConverter(itemContract, null, contract, member); JsonReader tokenReader = token.CreateReader(); + tokenReader.MaxDepth = Serializer.MaxDepth; tokenReader.ReadAndAssert(); // Move to first token object? result;