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

ruby-changes:16518

From: yugui <ko1@a...>
Date: Thu, 1 Jul 2010 16:42:13 +0900 (JST)
Subject: [ruby-changes:16518] Ruby:r28509 (ruby_1_9_2): merges r28457 from trunk into ruby_1_9_2.

yugui	2010-07-01 16:41:55 +0900 (Thu, 01 Jul 2010)

  New Revision: 28509

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

  Log:
    merges r28457 from trunk into ruby_1_9_2.
    --
    * thread.c (rb_fd_resize, rb_fd_copy): avoid NULL dereference upon
      failed realloc by using xrealloc instead of not realloc.  a patch
      from Jim Meyering <meyering at redhat.com> in [ruby-core:30920]
      [Bug #3489]

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/thread.c

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 28508)
+++ ruby_1_9_2/ChangeLog	(revision 28509)
@@ -1,3 +1,10 @@
+Mon Jun 28 21:56:14 2010  Yusuke Endoh  <mame@t...>
+
+	* thread.c (rb_fd_resize, rb_fd_copy): avoid NULL dereference upon
+	  failed realloc by using xrealloc instead of not realloc.  a patch
+	  from Jim Meyering <meyering at redhat.com> in [ruby-core:30920]
+	  [Bug #3489]
+
 Thu Jul  1 16:26:42 2010  NARUSE, Yui  <naruse@r...>
 
 	* thread_pthread.c (thread_start_func_1): don't call
Index: ruby_1_9_2/thread.c
===================================================================
--- ruby_1_9_2/thread.c	(revision 28508)
+++ ruby_1_9_2/thread.c	(revision 28509)
@@ -2285,7 +2285,7 @@
     if (o < sizeof(fd_set)) o = sizeof(fd_set);
 
     if (m > o) {
-	fds->fdset = realloc(fds->fdset, m);
+	fds->fdset = xrealloc(fds->fdset, m);
 	memset((char *)fds->fdset + o, 0, m - o);
     }
     if (n >= fds->maxfd) fds->maxfd = n + 1;
@@ -2319,7 +2319,7 @@
 
     if (size < sizeof(fd_set)) size = sizeof(fd_set);
     dst->maxfd = max;
-    dst->fdset = realloc(dst->fdset, size);
+    dst->fdset = xrealloc(dst->fdset, size);
     memcpy(dst->fdset, src, size);
 }
 

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

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