diff options
author | Alan Du <alanhdu@gmail.com> | 2017-05-31 00:07:15 +0100 |
---|---|---|
committer | Alan Du <alanhdu@gmail.com> | 2017-05-31 00:30:55 +0100 |
commit | 3322bcd086399a658253e119323f4b4c44aa91ff (patch) | |
tree | 2d6194dec004b1ca12db48b767ee44c2070472df /src | |
parent | 7aa2594fb0ccd528087a492d1497f3af580bdb54 (diff) | |
download | milf-rs-3322bcd086399a658253e119323f4b4c44aa91ff.tar.gz milf-rs-3322bcd086399a658253e119323f4b4c44aa91ff.zip |
Error when parsing numbers outside of f64's range
Diffstat (limited to 'src')
-rw-r--r-- | src/de.rs | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -893,6 +893,12 @@ impl<'a> Deserializer<'a> { } number.parse().map_err(|_e| { self.error(start, ErrorKind::NumberInvalid) + }).and_then(|n: f64| { + if n.is_finite() { + Ok(n) + } else { + Err(self.error(start, ErrorKind::NumberInvalid)) + } }) } |