Fix blocking_operation_wait use-after-free bug.

This commit is contained in:
Samuel Williams 2025-06-05 12:49:02 +09:00 committed by Samuel Williams
parent 81a23c5793
commit ead14b19aa
Notes: git 2025-06-06 04:13:28 +00:00
6 changed files with 350 additions and 51 deletions

View file

@ -1552,7 +1552,7 @@ rb_nogvl(void *(*func)(void *), void *data1,
if (flags & RB_NOGVL_OFFLOAD_SAFE) {
VALUE scheduler = rb_fiber_scheduler_current();
if (scheduler != Qnil) {
struct rb_fiber_scheduler_blocking_operation_state state;
struct rb_fiber_scheduler_blocking_operation_state state = {0};
VALUE result = rb_fiber_scheduler_blocking_operation_wait(scheduler, func, data1, ubf, data2, flags, &state);