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

ruby-changes:32486

From: nagachika <ko1@a...>
Date: Sun, 12 Jan 2014 15:53:46 +0900 (JST)
Subject: [ruby-changes:32486] nagachika:r44565 (ruby_2_0_0): merge revision(s) 44195: [Backport #7772]

nagachika	2014-01-12 15:53:41 +0900 (Sun, 12 Jan 2014)

  New Revision: 44565

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

  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_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/util.c
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 44564)
+++ ruby_2_0_0/ChangeLog	(revision 44565)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Sun Jan 12 15:33:11 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]
+
 Sun Jan 12 15:17:00 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/tk/tkutil/tkutil.c: use rb_sprintf(), rb_id2str(), and
Index: ruby_2_0_0/util.c
===================================================================
--- ruby_2_0_0/util.c	(revision 44564)
+++ ruby_2_0_0/util.c	(revision 44565)
@@ -309,7 +309,9 @@ ruby_qsort(void* base, const size_t nel, https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/util.c#L309
   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_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 44564)
+++ ruby_2_0_0/version.h	(revision 44565)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2014-01-12"
-#define RUBY_PATCHLEVEL 379
+#define RUBY_PATCHLEVEL 380
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 1

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


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

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