aboutsummaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-01 10:36:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-01 10:36:19 +0000
commitcbeec4561285b6afe00cd9bd61eebe9f5e3a6919 (patch)
tree7a1074c3bb86df5c860791df1178a3b9bfda93a3 /util.c
parenta6c52eec0c12226d2c1a86597fa59ff0c2516533 (diff)
downloadruby-cbeec4561285b6afe00cd9bd61eebe9f5e3a6919.tar.gz
* util.c (ruby_dtoa): allocates one more byte to get rid of buffer
overrun. a patch from Charlie Savage at [ruby-core:22604]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index 05a442ba76..50ddb2b315 100644
--- a/util.c
+++ b/util.c
@@ -3362,7 +3362,7 @@ ruby_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)