From 876c5fe1b2ba38fd893a81f91769b11f78cf4e92 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 27 Sep 2019 00:37:54 +0900 Subject: Check the argument size Ensure that argument array size does not overflow as `int`, before cast in thread_do_start after new thread created. --- thread.c | 1 + 1 file changed, 1 insertion(+) (limited to 'thread.c') diff --git a/thread.c b/thread.c index 66e3f8a7b1..9301e41696 100644 --- a/thread.c +++ b/thread.c @@ -842,6 +842,7 @@ thread_create_core(VALUE thval, VALUE args, VALUE (*fn)(void *)) th->invoke_arg.func.arg = (void *)args; } else { + (void)RARRAY_LENINT(args); th->invoke_type = thread_invoke_type_proc; th->invoke_arg.proc.proc = rb_block_proc(); th->invoke_arg.proc.args = args; -- cgit v1.2.3