Skip to content

Commit

Permalink
Backport #1232. Fixed sprintf buffer corruption.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@24583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
wyhaines committed Aug 19, 2009
1 parent b4f5ab9 commit 9c3ecf6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Wed Aug 19 1:49:00 2009 Kirk Haines <khaines@ruby-lang.org>

* Backport #1232; Writes one extra byte to the buffer in order to prevent overrun.

Tue Aug 4 8:53:00 2009 Kirk Haines <khaines@ruby-lang.org>

* lib/rdoc/parsers/parse_c.rb: Fixed a small error in the documentation.
Expand Down
2 changes: 1 addition & 1 deletion util.c
Original file line number Diff line number Diff line change
Expand Up @@ -3403,7 +3403,7 @@ dtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve)
if (i <= 0)
i = 1;
}
s = s0 = rv_alloc(i);
s = s0 = rv_alloc(i+1);

#ifdef Honor_FLT_ROUNDS
if (mode > 1 && rounding != 1)
Expand Down

0 comments on commit 9c3ecf6

Please sign in to comment.