aboutsummaryrefslogtreecommitdiff
path: root/src/de.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/de.rs')
-rw-r--r--src/de.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/de.rs b/src/de.rs
index bd4ead0..d5af272 100644
--- a/src/de.rs
+++ b/src/de.rs
@@ -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))
+ }
})
}