diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-17 08:15:47 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-17 08:15:47 +0000 |
commit | 999f6f820623b97b33733ce112aef91beb8918cc (patch) | |
tree | f6e7a741b333a27ecc3eddecf284572c70fb5f4c | |
parent | bfdc70f83c57619aedfcb52f4841085c3b2ea2d3 (diff) |
merge revision(s) 64915: [Backport #15205]
check argument type.
* iseq.c (iseqw_s_compile): check argument type (T_STRING) to
avoid SEGV.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@65111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | iseq.c | 5 | ||||
-rw-r--r-- | version.h | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -793,9 +793,14 @@ iseqw_s_compile(int argc, VALUE *argv, VALUE self) case 3: path = argv[--i]; case 2: file = argv[--i]; } + if (NIL_P(file)) file = rb_fstring_cstr("<compiled>"); + if (NIL_P(path)) path = file; if (NIL_P(line)) line = INT2FIX(1); + Check_Type(path, T_STRING); + Check_Type(file, T_STRING); + return iseqw_new(rb_iseq_compile_with_option(src, file, path, line, 0, opt)); } @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.4.5" #define RUBY_RELEASE_DATE "2018-10-17" -#define RUBY_PATCHLEVEL 325 +#define RUBY_PATCHLEVEL 326 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 10 |