aboutsummaryrefslogtreecommitdiffstats
path: root/error.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-27 15:21:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-27 15:21:01 +0000
commitc0cc34b6e1d861ee2182ceca9a9270cf2fe05f9a (patch)
treede7821e72ea94579e010881a80bb6b08362414bc /error.c
parent41a3eb0bd6e9cc90ad48ab99923c2a56459e0719 (diff)
downloadruby-c0cc34b6e1d861ee2182ceca9a9270cf2fe05f9a.tar.gz
error.c: check argument of Warning.warn
* error.c (rb_warning_s_warn): the argument must be an ASCII-compatible string. [ruby-core:77430] [Bug #12793] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r--error.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/error.c b/error.c
index 2fcacfaa5b..4758961e93 100644
--- a/error.c
+++ b/error.c
@@ -152,6 +152,8 @@ ruby_only_for_internal_use(const char *func)
static VALUE
rb_warning_s_warn(VALUE mod, VALUE str)
{
+ Check_Type(str, T_STRING);
+ rb_must_asciicompat(str);
rb_write_error_str(str);
return Qnil;
}