1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merge revision(s) 44195: [Backport #7772]

* util.c (ruby_qsort): fix potential stack overflow on a large
	  machine.  based on the patch by Conrad Irwin <conrad.irwin AT
	  gmail.com> at [ruby-core:51816].  [Bug #7772]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@44738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2014-01-29 04:00:44 +00:00
parent 0e58730795
commit 12aec90ddf
3 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,9 @@
Wed Jan 29 13:00:17 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* util.c (ruby_qsort): fix potential stack overflow on a large
machine. based on the patch by Conrad Irwin <conrad.irwin AT
gmail.com> at [ruby-core:51816]. [Bug #7772]
Wed Jan 29 12:54:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (local_push_gen, local_pop_gen): save cmdarg_stack to

4
util.c
View file

@ -278,7 +278,9 @@ ruby_qsort(void* base, const size_t nel, const size_t size,
char *L = base; /* left end of current region */
char *R = (char*)base + size*(nel-1); /* right end of current region */
size_t chklim = 63; /* threshold of ordering element check */
stack_node stack[32], *top = stack; /* 32 is enough for 32bit CPU */
enum {size_bits = sizeof(size) * CHAR_BIT};
stack_node stack[size_bits]; /* enough for size_t size */
stack_node *top = stack;
int mmkind;
size_t high, low, n;

View file

@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.3"
#define RUBY_PATCHLEVEL 492
#define RUBY_PATCHLEVEL 493
#define RUBY_RELEASE_DATE "2014-01-29"
#define RUBY_RELEASE_YEAR 2014