Subject: [Boost-bugs] [Boost C++ Libraries] #10806: boost::spirit::qi::double_ parse does not handle overflow but ASSERTs for it
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-11-20 06:37:45
#10806: boost::spirit::qi::double_ parse does not handle overflow but ASSERTs for
it
-------------------------------------+---------------------
Reporter: Glen Atkins <gatkins@â¦> | Owner: djowel
Type: Bugs | Status: new
Milestone: To Be Determined | Component: spirit
Version: Boost 1.57.0 | Severity: Problem
Keywords: |
-------------------------------------+---------------------
If a user puts an excessively high number (e.g. "2.3e+900") into the
parser it does not return an error, it instead overflows returning an
unexpected value.
In real_impl.hpp it calls traits::scale which ends up going to
pow10_helper<double>::call(unsigned dim).
This ASSERTs because dim is too large. But then it calls exponents[dim]
where dim exceeds the range of exponents.
I believe that parse should fail (return false) if the value in the string
exceeds the numeric limits of the floating point type.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10806> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC