From 9b4b5ad27c56ab713a95dfbfa84fdd74280fc9ca Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 27 Aug 2013 07:56:17 +0000 Subject: [PATCH] enumerator.c: add comment git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 3 ++- enumerator.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1303d97a6f..6e9e316c7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ Tue Aug 27 16:51:21 2013 Nobuyoshi Nakada - * enumerator.c (enumerator_each): ensure argument array size is int. + * enumerator.c (enumerator_each): ensure that argument array size + does not overflow at appending. Tue Aug 27 16:46:05 2013 Nobuyoshi Nakada diff --git a/enumerator.c b/enumerator.c index 51c09597a7..a83c0533d7 100644 --- a/enumerator.c +++ b/enumerator.c @@ -448,6 +448,7 @@ enumerator_each(int argc, VALUE *argv, VALUE obj) VALUE args = e->args; if (args) { #if SIZEOF_INT < SIZEOF_LONG + /* check int range overflow */ rb_long2int(RARRAY_LEN(args) + argc); #endif args = rb_ary_dup(args);