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

ruby-changes:55480

From: usa <ko1@a...>
Date: Tue, 23 Apr 2019 11:54:50 +0900 (JST)
Subject: [ruby-changes:55480] usa:073cc5e815 (ruby_2_0_0): merge revision(s): 53153 and 23405@ruby_1_9_1

usa	2015-12-16 21:30:28 +0900 (Wed, 16 Dec 2015)

  New Revision: 073cc5e815

  https://git.ruby-lang.org/ruby.git/commit/?id=073cc5e815

  Log:
    merge revision(s): 53153 and 23405@ruby_1_9_1
    
    * ext/fiddle/handle.c: check tainted string arguments.
      Patch provided by tenderlove and nobu.
    
    * test/fiddle/test_handle.rb (class TestHandle): add test for above.
    
    * ext/dl/handle.c (rb_dlhandle_initialize): prohibits DL::dlopen
      with a tainted name of library.
      Patch by sheepman <sheepman AT sheepman.sakura.ne.jp>.
    
    * ext/dl/handle.c (rb_dlhandle_sym): ditto
    
    
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@53161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

  Modified files:
    ChangeLog
    ext/dl/handle.c
    ext/fiddle/handle.c
    test/fiddle/test_handle.rb
    version.h
Index: v1_1r/time.c
===================================================================
--- v1_1r/time.c	(revision 72)
+++ v1_1r/time.c	(revision 73)
@@ -233,7 +233,7 @@ time_gm_or_local(argc, argv, gm_or_local https://github.com/ruby/ruby/blob/trunk/v1_1r/time.c#L233
     tm = (*fn)(&guess);
     if (!tm) goto error;
     t = args[0];
-    while (diff = t - tm->tm_year) {
+    while (diff = t - (tm->tm_year)) {
 	guess += diff * 364 * 24 * 3600;
 	if (guess < 0) ArgError("too far future");
 	tm = (*fn)(&guess);
@@ -253,7 +253,7 @@ time_gm_or_local(argc, argv, gm_or_local https://github.com/ruby/ruby/blob/trunk/v1_1r/time.c#L253
     return time_new_internal(class, guess, 0);
 
   error:
-    ArgError("gmtime error");
+    ArgError("gmtime/localtime error");
 }
 
 static VALUE
@@ -576,7 +576,7 @@ time_mon(time) https://github.com/ruby/ruby/blob/trunk/v1_1r/time.c#L576
     if (tobj->tm_got == 0) {
 	time_localtime(time);
     }
-    return INT2FIX(tobj->tm.tm_mon);
+    return INT2FIX(tobj->tm.tm_mon+1);
 }
 
 static VALUE
@@ -589,7 +589,7 @@ time_year(time) https://github.com/ruby/ruby/blob/trunk/v1_1r/time.c#L589
     if (tobj->tm_got == 0) {
 	time_localtime(time);
     }
-    return INT2FIX(tobj->tm.tm_year);
+    return INT2FIX(tobj->tm.tm_year+1900);
 }
 
 static VALUE
@@ -664,8 +664,8 @@ time_to_a(time) https://github.com/ruby/ruby/blob/trunk/v1_1r/time.c#L664
 		   INT2FIX(tobj->tm.tm_min),
 		   INT2FIX(tobj->tm.tm_hour),
 		   INT2FIX(tobj->tm.tm_mday),
-		   INT2FIX(tobj->tm.tm_mon),
-		   INT2FIX(tobj->tm.tm_year),
+		   INT2FIX(tobj->tm.tm_mon+1),
+		   INT2FIX(tobj->tm.tm_year+1900),
 		   INT2FIX(tobj->tm.tm_wday),
 		   INT2FIX(tobj->tm.tm_yday),
 		   INT2FIX(tobj->tm.tm_isdst));

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

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