id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 6955,Spirit parse_nan() may dereference end iterator,michael.douglas.schmidt@…,Joel de Guzman,"The function `parse_nan(first, last)` will dereference the end iterator when parsing the string ""nan"", which may lead to undefined behavior. {{{ File: boost/spirit/home/qi/numeric/real_policies.hpp Line: 119 }}} This occurs for instance using the following parser: {{{ std::string s = ""nan""; auto s_begin = s.begin(); auto s_end = s.end(); double out; qi::phrase_parse(s_begin, s_end, qi::double_, ascii::space, out); }}} The problem occurs in parse_nan(): {{{ 117: if (detail::string_parse(""nan"", ""NAN"", first, last, unused)) 118: { 119: if (*first == '(') }}} Line 119 should check if `first == last` first since `detail::string_parse()` may increment `first`. ",Bugs,closed,To Be Determined,spirit,Boost 1.49.0,Problem,fixed,nan,