[前][次][番号順一覧][スレッド一覧]

ruby-changes:57947

From: Nobuyoshi <ko1@a...>
Date: Fri, 27 Sep 2019 00:39:38 +0900 (JST)
Subject: [ruby-changes:57947] 876c5fe1b2 (master): Check the argument size

https://git.ruby-lang.org/ruby.git/commit/?id=876c5fe1b2

From 876c5fe1b2ba38fd893a81f91769b11f78cf4e92 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
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.

diff --git a/thread.c b/thread.c
index 66e3f8a..9301e41 100644
--- a/thread.c
+++ b/thread.c
@@ -842,6 +842,7 @@ thread_create_core(VALUE thval, VALUE args, VALUE (*fn)(void *)) https://github.com/ruby/ruby/blob/trunk/thread.c#L842
         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 v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]