diff options
author | wyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-19 13:53:23 +0000 |
---|---|---|
committer | wyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-19 13:53:23 +0000 |
commit | 9c3ecf6fbfa694edfcad48417b7fb5f5e85a737b (patch) | |
tree | c86190be333f5f8a7e6e1bf86f3cf0ef387e2ae7 | |
parent | b4f5ab964737d16791634b96a4b2cf2007effa16 (diff) |
Backport #1232. Fixed sprintf buffer corruption.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@24583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | util.c | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -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. @@ -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) |