Skip to content

Commit

Permalink
* vsnprintf.c (BSD__uqtoa): Fix overflow when long != quad_t.
Browse files Browse the repository at this point in the history
  patched by Peter Weldon <peter.weldon AT null.net>
  [ruby-core:33985]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nurse committed Dec 30, 2010
1 parent 6eae4ec commit 3d38ba8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions 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]

Fri Dec 31 03:00:34 2010 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>

* Makefile.in: remove unnecessary semicolons.
Expand Down
3 changes: 3 additions & 0 deletions test/ruby/test_time.rb
Expand Up @@ -634,6 +634,9 @@ def test_strftime
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
Expand Down
2 changes: 1 addition & 1 deletion vsnprintf.c
Expand Up @@ -368,7 +368,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
Expand Down

0 comments on commit 3d38ba8

Please sign in to comment.