Skip to content

Commit 0b7bb7f

Browse files
committed
merge revision(s) r46416: [Backport ruby#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
1 parent 5acdbee commit 0b7bb7f

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Sun Jul 13 23:02:36 2014 Nobuyoshi Nakada <[email protected]>
2+
3+
* array.c (rb_ary_permutation): `p` is the array of size `r`, as
4+
commented at permute0(). since `n >= r` here, buffer overflow
5+
never happened, just reduce unnecessary allocation though.
6+
17
Sun Jul 13 22:52:43 2014 Nobuyoshi Nakada <[email protected]>
28

39
* pack.c (encodes): fix buffer overrun by tail_lf. Thanks to

array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4818,7 +4818,7 @@ rb_ary_permutation(int argc, VALUE *argv, VALUE ary)
48184818
}
48194819
}
48204820
else { /* this is the general case */
4821-
volatile VALUE t0 = tmpbuf(n,sizeof(long));
4821+
volatile VALUE t0 = tmpbuf(r,sizeof(long));
48224822
long *p = (long*)RSTRING_PTR(t0);
48234823
volatile VALUE t1 = tmpbuf(n,sizeof(char));
48244824
char *used = (char*)RSTRING_PTR(t1);

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.1.2"
22
#define RUBY_RELEASE_DATE "2014-07-13"
3-
#define RUBY_PATCHLEVEL 171
3+
#define RUBY_PATCHLEVEL 172
44

55
#define RUBY_RELEASE_YEAR 2014
66
#define RUBY_RELEASE_MONTH 7

0 commit comments

Comments
 (0)