diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-20 01:48:24 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-20 01:48:24 +0000 |
commit | 05ba0b1dd52193c57c149115839f81e929b11626 (patch) | |
tree | d9b34b34141eebe54a0c09a34be4a17d13a307ed /util.c | |
parent | 9e14a3fa1d851525374a4bb0b3d1100f2e88a297 (diff) |
* util.c (ruby_strtod): reject 0x1.p+0. [ruby-dev:42432] #3966
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -2132,10 +2132,11 @@ break2: if (*s == '.') { aadj = 1.; - while (*++s && (s1 = strchr(hexdigit, *s))) { + if (!*++s || !(s1 = strchr(hexdigit, *s))) goto ret0; + do { aadj /= 16; adj += aadj * ((s1 - hexdigit) & 15); - } + } while (*++s && (s1 = strchr(hexdigit, *s))); } if (*s == 'P' || *s == 'p') { |