From 65f7aa19a923baf7db4bfe13886f697d26a43061 Mon Sep 17 00:00:00 2001 From: normal Date: Tue, 26 Aug 2014 23:00:37 +0000 Subject: [PATCH] compile.c (iseq_set_sequence): check for multiplication overflow git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ compile.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 181e07b166..b4765ba0f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Aug 27 07:59:17 2014 Eric Wong + + * compile.c (iseq_set_sequence): check for multiplication overflow + Tue Aug 26 22:07:42 2014 SHIBATA Hiroshi * test/ruby/test_complex.rb: cherry-picked working assertions from r47251. diff --git a/compile.c b/compile.c index 1cd78c7294..52409e23f5 100644 --- a/compile.c +++ b/compile.c @@ -1649,7 +1649,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor) iseq->iseq_size = pos; iseq->stack_max = stack_max; - line_info_table = ruby_xrealloc(line_info_table, k * sizeof(struct iseq_line_info_entry)); + line_info_table = REALLOC_N(line_info_table, struct iseq_line_info_entry, k); iseq->line_info_table = line_info_table; iseq->line_info_size = k;