summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--test/ruby/test_time.rb3
-rw-r--r--version.h2
-rw-r--r--vsnprintf.c2
4 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e605643aa9..8197149dd2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Dec 31 03:23:26 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * vsnprintf.c (BSD__uqtoa): Fix overflow when long != quad_t.
+ patched by Peter Weldon <peter.weldon AT null.net>
+ [ruby-core:33985]
+
Wed Jan 5 12:10:08 2011 Aaron Patterson <aaron@tenderlovemaking.com>
* Use _WIN32 rather than checking for windows.h. Thanks Jon Forums!
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index 13b95b94f9..520d15971c 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -632,6 +632,9 @@ class TestTime < Test::Unit::TestCase
t.strftime("%m/%d/%Y %l:%M:%S.%9N"))
assert_equal("03/14/1592 6:53:58.97932384",
t.strftime("%m/%d/%Y %l:%M:%S.%8N"))
+
+ # [ruby-core:33985]
+ assert_equal("3000000000", Time.at(3000000000).strftime('%s'))
end
def test_delegate
diff --git a/version.h b/version.h
index a2d9455a64..d509b4a120 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 142
+#define RUBY_PATCHLEVEL 143
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 9
#define RUBY_VERSION_TEENY 1
diff --git a/vsnprintf.c b/vsnprintf.c
index a1ac4424a2..697d5fce08 100644
--- a/vsnprintf.c
+++ b/vsnprintf.c
@@ -362,7 +362,7 @@ static char *
BSD__uqtoa(register u_quad_t val, char *endp, int base, int octzero, const char *xdigs)
{
register char *cp = endp;
- register long sval;
+ register quad_t sval;
/*
* Handle the three cases separately, in the hope of getting