summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-13 01:15:39 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-09-13 01:15:39 (GMT)
commit2590d7447a96ba81a1ea2ae5b0e705f00a1631ac (patch)
treea120d3f77c83afe93ddb6ee27514c0812d822b12 /util.c
parent1973984f903fd6149034308e4723aa090801b69a (diff)
* util.c (ruby_strtod): reject Float('0x0.').
[ruby-dev:42239] Bug #3820 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/util.c b/util.c
index 40b4573..94396a3 100644
--- a/util.c
+++ b/util.c
@@ -2122,6 +2122,7 @@ break2:
static const char hexdigit[] = "0123456789abcdef0123456789ABCDEF";
s0 = ++s;
adj = 0;
+ aadj = -1;
if (!*++s || !(s1 = strchr(hexdigit, *s))) goto ret0;
do {
@@ -2159,6 +2160,7 @@ break2:
dval(rv) = ldexp(adj, nd * dsign);
}
else {
+ if (aadj != -1) goto ret0;
dval(rv) = adj;
}
goto ret;