From dd5fd65eef79637a951a766f5488724c87937c41 Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 18 Dec 2015 07:51:58 +0000 Subject: * compile.c (ibf_load_setup): check tainted string argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'compile.c') diff --git a/compile.c b/compile.c index 995ff8930c..f858fbb681 100644 --- a/compile.c +++ b/compile.c @@ -8203,6 +8203,8 @@ ibf_load_iseq(const struct ibf_load *load, const rb_iseq_t *index_iseq) static void ibf_load_setup(struct ibf_load *load, VALUE loader_obj, VALUE str) { + rb_check_safe_obj(str); + if (RSTRING_LENINT(str) < (int)sizeof(struct ibf_header)) { rb_raise(rb_eRuntimeError, "broken binary format"); } -- cgit v1.2.3