mirror of
https://github.com/ruby/ruby.git
synced 2026-10-29 17:06:21 +08:00
io_reader trusted IO#read to honour its size argument and copied RSTRING_LEN(string) bytes into libyaml's fixed-capacity buffer. An IO-like object whose #read over-returns wrote past the buffer end, a heap out-of-bounds write reachable from Psych.load/safe_load/parse. Clamp the copied length to the requested size. https://github.com/ruby/psych/commit/99ecd94560 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>