Skip to content

Recheck frozen state after option conversions in JSON::State - #1162

Merged
byroot merged 1 commit into
ruby:masterfrom
byroot:fix-state-as-json-frozen-after-to_proc
Dec 5, 2026
Merged

byroot merged 1 commit into
ruby:masterfrom
byroot:fix-state-as-json-frozen-after-to_proc

Conversation

@byroot

@byroot byroot commented Dec 5, 2026

Copy link
Copy Markdown
Member

as_json=, max_nesting=, depth= and #configure only checked frozenness on entry, but then called user code (to_proc, to_int) which could freeze the receiver before the write happened.

I think if you're running into this you deserve it, but if that can appease bots...

`as_json=`, `max_nesting=`, `depth=` and `#configure` only checked
frozenness on entry, but then called user code (`to_proc`, `to_int`)
which could freeze the receiver before the write happened.

Reported-By: Ryan Lopopolo <rjl@hyperbo.la>
@byroot
byroot force-pushed the fix-state-as-json-frozen-after-to_proc branch from 1b79057 to 8caec91 Compare December 5, 2026 09:47
@byroot
byroot merged commit 6f971d2 into ruby:master Dec 5, 2026
42 checks passed
@byroot
byroot deleted the fix-state-as-json-frozen-after-to_proc branch December 5, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant