diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-09 13:59:53 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-09 13:59:53 +0000 |
commit | c14ab348a1bce037e8c1f50a0504a11379a90887 (patch) | |
tree | 44ea87966e47b5988be50ca08fa8ce8ba750278d | |
parent | 0628973435abeccf676f3c2563579b3dbab06976 (diff) | |
download | ruby-c14ab348a1bce037e8c1f50a0504a11379a90887.tar.gz |
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_5@64978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | iseq.c | 5 | ||||
-rw-r--r-- | version.h | 6 |
2 files changed, 8 insertions, 3 deletions
@@ -861,9 +861,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,10 +1,10 @@ #define RUBY_VERSION "2.5.2" -#define RUBY_RELEASE_DATE "2018-10-01" -#define RUBY_PATCHLEVEL 91 +#define RUBY_RELEASE_DATE "2018-10-09" +#define RUBY_PATCHLEVEL 92 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 10 -#define RUBY_RELEASE_DAY 1 +#define RUBY_RELEASE_DAY 9 #include "ruby/version.h" |