1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Check the argument size

Ensure that argument array size does not overflow as `int`, before
cast in thread_do_start after new thread created.
This commit is contained in:
Nobuyoshi Nakada 2019-09-27 00:37:54 +09:00
parent 3b9cdc59ce
commit 876c5fe1b2
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -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;