Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix StackOverflow exception when NewtonsoftJsonSerializer tries to deserialize a JObject inside an object field #6503

Merged
merged 4 commits into from
Mar 15, 2023

Conversation

Arkatufus
Copy link
Contributor

@Arkatufus Arkatufus commented Mar 9, 2023

Fixes #6502

Changes

An object property was assigned a JObject instance, causing StackOverflow in NewtonsoftJsonSerializer. To avoid this, we need to iterate over the JObject and do our own deserialization.

@Aaronontheweb
Copy link
Member

Yep, looks like you reproduced it alright:

The active test run was aborted. Reason: Test host process crashed : Stack overflow.

@Arkatufus Arkatufus changed the title Reproduction for #6502 Fix StackOverflow exception when NewtonsoftJsonSerializer tries to deserialize a JObject inside an object field Mar 14, 2023
Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aaronontheweb Aaronontheweb merged commit 64c6eff into akkadotnet:dev Mar 15, 2023
Arkatufus added a commit to Arkatufus/akka.net that referenced this pull request Mar 15, 2023
…o deserialize a `JObject` inside an `object` field (akkadotnet#6503)

* Reproduction for  akkadotnet#6502

* Fix JObject inside object property/field overflow

---------

Co-authored-by: Aaron Stannard <[email protected]>
(cherry picked from commit 64c6eff)
Aaronontheweb pushed a commit that referenced this pull request Mar 15, 2023
…rializer` tries to deserialize a `JObject` inside an `object` field (#6522)

* Fix `StackOverflow` exception when `NewtonsoftJsonSerializer` tries to deserialize a `JObject` inside an `object` field (#6503)

* Reproduction for  #6502

* Fix JObject inside object property/field overflow

---------

Co-authored-by: Aaron Stannard <[email protected]>
(cherry picked from commit 64c6eff)

* Remove nullable support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NewtonSoftJsonSerializer throws a StackOverflow exception when trying to deserialize an object field
2 participants