diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-06 01:00:29 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-09-06 01:00:29 +0000 |
commit | a69423beb8e9d827eb4cadda35b21586767d8737 (patch) | |
tree | f7c175e84e14349714bf31bcd3da46c0292b805f /util.c | |
parent | 0ed5aee00074547ed58c55bef6d346a9a4dd4925 (diff) | |
download | ruby-a69423beb8e9d827eb4cadda35b21586767d8737.tar.gz |
* util.c (ruby_strtod): check there is at least 1 digit after
"0x" before ".". [ruby-dev:42183] #3790
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -2123,10 +2123,11 @@ break2: s0 = ++s; adj = 0; - while (*++s && (s1 = strchr(hexdigit, *s))) { + if (!*++s || !(s1 = strchr(hexdigit, *s))) goto ret0; + do { adj *= 16; adj += (s1 - hexdigit) & 15; - } + } while (*++s && (s1 = strchr(hexdigit, *s))); if (*s == '.') { aadj = 1.; |