[前][次][番号順一覧][スレッド一覧]

ruby-changes:32659

From: usa <ko1@a...>
Date: Wed, 29 Jan 2014 13:00:48 +0900 (JST)
Subject: [ruby-changes:32659] usa:r44738 (ruby_1_9_3): merge revision(s) 44195: [Backport #7772]

usa	2014-01-29 13:00:44 +0900 (Wed, 29 Jan 2014)

  New Revision: 44738

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44738

  Log:
    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]

  Modified directories:
    branches/ruby_1_9_3/
  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/util.c
    branches/ruby_1_9_3/version.h
Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 44737)
+++ ruby_1_9_3/ChangeLog	(revision 44738)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1
+Wed Jan 29 13:00:17 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@r...>
 
 	* parse.y (local_push_gen, local_pop_gen): save cmdarg_stack to
Index: ruby_1_9_3/util.c
===================================================================
--- ruby_1_9_3/util.c	(revision 44737)
+++ ruby_1_9_3/util.c	(revision 44738)
@@ -278,7 +278,9 @@ ruby_qsort(void* base, const size_t nel, https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/util.c#L278
   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;
 
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 44737)
+++ ruby_1_9_3/version.h	(revision 44738)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1
 #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

Property changes on: ruby_1_9_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r44195


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]