summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-01 10:41:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-01 10:41:26 +0000
commit64603725aa485e14b0a06fbfc94c11f0b0d42de6 (patch)
tree7557d10f77e7ade0440bcf07d21f4024d17b909d /util.c
parent643bfbb49c6e8ccd4fd6241e17b338366486475f (diff)
* 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/branches/ruby_1_8@22694 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 de18895cb7..e74277e679 100644
--- a/util.c
+++ b/util.c
@@ -3409,7 +3409,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)