diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-09-27 00:37:54 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-09-27 00:38:12 +0900 |
commit | 876c5fe1b2ba38fd893a81f91769b11f78cf4e92 (patch) | |
tree | 1e3c0bf6d6304d189315b1559ad07256dac72813 /thread.c | |
parent | 3b9cdc59ce7c992f1906638be6acf2a9eeb6d58b (diff) | |
download | ruby-876c5fe1b2ba38fd893a81f91769b11f78cf4e92.tar.gz |
Check the argument size
Ensure that argument array size does not overflow as `int`, before
cast in thread_do_start after new thread created.
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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; |