on master help sign in
Reject floating point numbers that lack a fractional part
ecfca35Bryan O'Sullivan
Data/Aeson/Parser/Internal.hs+1−1
@@ -328,7 +328,7 @@ scientific = do
328 dotty <- A.peekWord8
328 dotty <- A.peekWord8
329 -- '.' -> ascii 46
329 -- '.' -> ascii 46
330 SP c e <- case dotty of
330 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)
332 _ -> pure (SP n 0)
332 _ -> pure (SP n 0)
333
333
334 let !signedCoeff | positive = c
334 let !signedCoeff | positive = c
tests/UnitTests.hs−5
@@ -667,11 +667,6 @@ _blacklist = HashSet.fromList [
667 , "i_string_not_in_unicode_range.json"
667 , "i_string_not_in_unicode_range.json"
668 , "i_string_truncated-utf-8.json"
668 , "i_string_truncated-utf-8.json"
669 , "i_structure_UTF-8_BOM_empty_object.json"
669 , "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"
675 , "n_number_neg_int_starting_with_zero.json"
670 , "n_number_neg_int_starting_with_zero.json"
676 , "n_number_real_without_fractional_part.json"
671 , "n_number_real_without_fractional_part.json"
677 , "n_number_with_leading_zero.json"
672 , "n_number_with_leading_zero.json"