Subject: [Boost-bugs] [Boost C++ Libraries] #9400: Boost spirit double_ parser crashes (array out of bounds) on values over 1e308
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-11-17 00:42:21
#9400: Boost spirit double_ parser crashes (array out of bounds) on values over
1e308
-------------------------------+-------------------------
Reporter: michael.schmidt@⦠| Owner: djowel
Type: Bugs | Status: new
Milestone: To Be Determined | Component: spirit
Version: Boost 1.55.0 | Severity: Showstopper
Keywords: |
-------------------------------+-------------------------
How to reproduce:
{{{
std::string test = "00573e443ef8ec10b5a1f23ac8964c43c415cedf";
std::string::const_iterator s_begin = test .begin();
std::string::const_iterator s_end = test .end();
boost::spirit::qi::phrase_parse(s_begin, s_end,
boost::spirit::qi::double_, boost::spirit::iso8859_1::space, out);
}}}
Note that this value get's interpreted as a double 573E+443.
There is an array index out of bounds in the function:
{{{
boost/spirit/home/support/detail/pow10.hpp, line 88
}}}
because the exponent larger than 308. I suggest throwing an exception here
if the exponent is >308 so that we can handle if a user enters a value
larger than the max double. Otherwise the double_ parser is unusable for
user input or user provided data.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9400> 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:14 UTC