id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 10755,"Wrong overflow checking with uint_parser",hoernse ,Joel de Guzman,"Lacking a default unsigned integer parser for one uint_8t I have defined {{{uint_parser}}} to parse IPs. If an octet goes beyond 255 it is to be expected that the parser only matches the first two digits leaving the third digit (and further digits) unconsumed. However, if the first two digits happen to be ""25"" and the third digit is greater than 5, the output attribute is incorrectly set to 250 instead of 25. The third digit is (correctly) not consumed, meaning we get a three digit result from consuming two digits. The Example {{{ #include #include #include #include ""boost/spirit/include/qi.hpp"" int main() { using namespace boost::spirit::qi; unsigned char octet; std::vector v; uint_parser uchar_; v.push_back(""255""); v.push_back(""256""); v.push_back(""257""); v.push_back(""258""); v.push_back(""259""); v.push_back(""260""); for (std::vector::iterator i = v.begin(); i < v.end(); i++) { std::string::const_iterator ib = i->begin(); std::string::const_iterator ie = i->end(); std::cout << ""parsing "" << *i; if (parse(ib, ie, uchar_, octet)) { std::cout << "" returned "" << (unsigned int)octet << ""\n""; } else { std::cout << "" failed\n""; } } getch(); return 0; } }}} outputs {{{ parsing 255 returned 255 parsing 256 returned 250 parsing 257 returned 250 parsing 258 returned 250 parsing 259 returned 250 parsing 260 returned 26 }}} This bug might extend to other numeric parsers. I have not checked that yet.",Bugs,closed,To Be Determined,spirit,Boost 1.54.0,Problem,fixed,,