mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@46807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5c1a69452b
commit
aa8380e17a
3 changed files with 8 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Sun Jul 13 23:02:36 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Sun Jul 13 22:52:43 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* pack.c (encodes): fix buffer overrun by tail_lf. Thanks to
|
* pack.c (encodes): fix buffer overrun by tail_lf. Thanks to
|
||||||
|
|
2
array.c
2
array.c
|
@ -4818,7 +4818,7 @@ rb_ary_permutation(int argc, VALUE *argv, VALUE ary)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { /* this is the general case */
|
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);
|
long *p = (long*)RSTRING_PTR(t0);
|
||||||
volatile VALUE t1 = tmpbuf(n,sizeof(char));
|
volatile VALUE t1 = tmpbuf(n,sizeof(char));
|
||||||
char *used = (char*)RSTRING_PTR(t1);
|
char *used = (char*)RSTRING_PTR(t1);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#define RUBY_VERSION "2.1.2"
|
#define RUBY_VERSION "2.1.2"
|
||||||
#define RUBY_RELEASE_DATE "2014-07-13"
|
#define RUBY_RELEASE_DATE "2014-07-13"
|
||||||
#define RUBY_PATCHLEVEL 171
|
#define RUBY_PATCHLEVEL 172
|
||||||
|
|
||||||
#define RUBY_RELEASE_YEAR 2014
|
#define RUBY_RELEASE_YEAR 2014
|
||||||
#define RUBY_RELEASE_MONTH 7
|
#define RUBY_RELEASE_MONTH 7
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue