ruby-changes:43145
From: rhe <ko1@a...>
Date: Mon, 30 May 2016 22:02:17 +0900 (JST)
Subject: [ruby-changes:43145] rhe:r55219 (trunk): openssl: use NUM2TIMET() to convert Integer to time_t
rhe 2016-05-30 22:02:13 +0900 (Mon, 30 May 2016) New Revision: 55219 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55219 Log: openssl: use NUM2TIMET() to convert Integer to time_t * ext/openssl/ossl_asn1.c (time_to_time_t): Use NUM2TIMET() instead of NUM2LONG(). time_t may be larger than long. [ruby-core:45552] [Bug #6571] Modified files: trunk/ChangeLog trunk/ext/openssl/ossl_asn1.c Index: ext/openssl/ossl_asn1.c =================================================================== --- ext/openssl/ossl_asn1.c (revision 55218) +++ ext/openssl/ossl_asn1.c (revision 55219) @@ -75,15 +75,10 @@ asn1time_to_time(ASN1_TIME *time) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_asn1.c#L75 return rb_funcall2(rb_cTime, rb_intern("utc"), 6, argv); } -/* - * This function is not exported in Ruby's *.h - */ -extern struct timeval rb_time_timeval(VALUE); - time_t time_to_time_t(VALUE time) { - return (time_t)NUM2LONG(rb_Integer(time)); + return (time_t)NUM2TIMET(rb_Integer(time)); } /* Index: ChangeLog =================================================================== --- ChangeLog (revision 55218) +++ ChangeLog (revision 55219) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon May 30 22:02:01 2016 Kazuki Yamaguchi <k@r...> + + * ext/openssl/ossl_asn1.c (time_to_time_t): Use NUM2TIMET() instead of + NUM2LONG(). time_t may be larger than long. + [ruby-core:45552] [Bug #6571] + Mon May 30 21:15:37 2016 Martin Duerst <duerst@i...> * string.c: Document current behavior for other case mapping methods -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/