Files
Hiroshi SHIBATAandClaude Opus 5 84a30ecc87 [ruby/psych] Reject a reentrant Psych::Parser#parse
The parser calls back into Ruby for every event, so a handler can call
#parse again on the same object. That reinitialised the parser and
re-pointed it at new input while the outer loop was still driving it,
which left the outer loop reading the inner document's freed buffer, or
resuming on a parser with no input at all and tripping libyaml's
read_handler assertion.

Psych::Exception is used so the caller can rescue it, and the in-use
flag is cleared with rb_ensure so a parser stays reusable afterwards.

https://github.com/ruby/psych/commit/5f2e37dc1c

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 01:05:51 +00:00
..