ruby-changes:34724
From: nagachika <ko1@a...>
Date: Sun, 13 Jul 2014 23:08:55 +0900 (JST)
Subject: [ruby-changes:34724] nagachika:r46807 (ruby_2_1): merge revision(s) r46416: [Backport #9942]
nagachika 2014-07-13 23:08:48 +0900 (Sun, 13 Jul 2014) New Revision: 46807 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46807 Log: merge revision(s) r46416: [Backport #9942] * array.c (rb_ary_permutation): `p` is the array of size `r`, as commented at permute0(). since `n >= r` here, buffer overflow never happened, just reduce unnecessary allocation though. Modified directories: branches/ruby_2_1/ Modified files: branches/ruby_2_1/ChangeLog branches/ruby_2_1/array.c branches/ruby_2_1/version.h Index: ruby_2_1/array.c =================================================================== --- ruby_2_1/array.c (revision 46806) +++ ruby_2_1/array.c (revision 46807) @@ -4818,7 +4818,7 @@ rb_ary_permutation(int argc, VALUE *argv https://github.com/ruby/ruby/blob/trunk/ruby_2_1/array.c#L4818 } } else { /* this is the general case */ - volatile VALUE t0 = tmpbuf(n,sizeof(long)); + volatile VALUE t0 = tmpbuf(r,sizeof(long)); long *p = (long*)RSTRING_PTR(t0); volatile VALUE t1 = tmpbuf(n,sizeof(char)); char *used = (char*)RSTRING_PTR(t1); Index: ruby_2_1/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 46806) +++ ruby_2_1/ChangeLog (revision 46807) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Sun Jul 13 23:02:36 2014 Nobuyoshi Nakada <nobu@r...> + + * array.c (rb_ary_permutation): `p` is the array of size `r`, as + commented at permute0(). since `n >= r` here, buffer overflow + never happened, just reduce unnecessary allocation though. + Sun Jul 13 22:52:43 2014 Nobuyoshi Nakada <nobu@r...> * pack.c (encodes): fix buffer overrun by tail_lf. Thanks to Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 46806) +++ ruby_2_1/version.h (revision 46807) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.2" #define RUBY_RELEASE_DATE "2014-07-13" -#define RUBY_PATCHLEVEL 171 +#define RUBY_PATCHLEVEL 172 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 7 Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r46416 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/