Ticket #5688 (closed bug: fixed)
instance Read Integer/Rational/Double readsPrec out of memory and crash due to exponential notation
| Reported by: | gracjan | Owned by: | igloo |
|---|---|---|---|
| Priority: | highest | Milestone: | 7.4.2 |
| Component: | libraries/base | Version: | 6.12.3 |
| Keywords: | Cc: | gale@…, iustin@…, anton.nik@… | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Runtime crash | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description (last modified by igloo) (diff)
GHCi, version 6.12.3: http://www.haskell.org/ghc/ Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package ffi-1.0 ... linking ... done. 120000000000 Prelude> read "12e1000000000000" :: Integer Segmentation fault
Sometimes it fails with Bus error.
According to Haskell'98 and Haskell'00 Reports Integers should not parse exponential notation at all.
http://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-190002.5
This is security issue in web frameworks as parsing HTTP headers, URLs, JSON and other may involve parsing integers.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

