Skip to content

Commit ecfca35

Browse files
committed
Reject floating point numbers that lack a fractional part
Once again, this was identified by JSONTestSuite, and is disallowed by RFC 7159.
1 parent df61ba7 commit ecfca35

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

Data/Aeson/Parser/Internal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ scientific = do
328328
dotty <- A.peekWord8
329329
-- '.' -> ascii 46
330330
SP c e <- case dotty of
331-
Just 46 -> A.anyWord8 *> (f <$> A.takeWhile isDigit_w8)
331+
Just 46 -> A.anyWord8 *> (f <$> A.takeWhile1 isDigit_w8)
332332
_ -> pure (SP n 0)
333333

334334
let !signedCoeff | positive = c

tests/UnitTests.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -667,11 +667,6 @@ _blacklist = HashSet.fromList [
667667
, "i_string_not_in_unicode_range.json"
668668
, "i_string_truncated-utf-8.json"
669669
, "i_structure_UTF-8_BOM_empty_object.json"
670-
, "n_number_-2..json"
671-
, "n_number_0.e1.json"
672-
, "n_number_2.e+3.json"
673-
, "n_number_2.e-3.json"
674-
, "n_number_2.e3.json"
675670
, "n_number_neg_int_starting_with_zero.json"
676671
, "n_number_real_without_fractional_part.json"
677672
, "n_number_with_leading_zero.json"

0 commit comments

Comments
 (0)