aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-30 13:02:13 +0000
committerrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-30 13:02:13 +0000
commitfc58550b267abad481512b035baa065ce2399778 (patch)
tree818278168c0b579e66f2f26f5b46a6fb7795a9e2
parent56eadc4f95970ba55375ceae6a7a738bc26f437d (diff)
downloadruby-fc58550b267abad481512b035baa065ce2399778.tar.gz
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--ext/openssl/ossl_asn1.c7
2 files changed, 7 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index da3cfb3310..28dfd653fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon May 30 22:02:01 2016 Kazuki Yamaguchi <k@rhe.jp>
+
+ * 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@it.aoyama.ac.jp>
* string.c: Document current behavior for other case mapping methods
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c
index e77adbf9f8..43a3d2d88a 100644
--- a/ext/openssl/ossl_asn1.c
+++ b/ext/openssl/ossl_asn1.c
@@ -75,15 +75,10 @@ asn1time_to_time(ASN1_TIME *time)
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));
}
/*