Use unsigned type in percent_encoding to prevent overflow for %80..%ff

Related fix in Boost.Spirit 80414bc688
This commit is contained in:
Michael Krasnyk 2018-01-07 12:50:45 +01:00 committed by Patrick Niklaus
parent 55cc06fd8b
commit a8f3474996
2 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@
- Changes from 5.14.3:
- Bugfixes:
- FIXED #4704: Fixed regression in bearings reordering introduced in 5.13 [#4704](https://github.com/Project-OSRM/osrm-backend/issues/4704)
- FIXED #4781: Fixed overflow exceptions in percent-encoding parsing
- Guidance:
- CHANGED #4706: Guidance refactoring step to decouple intersection connectivity analysis and turn instructions generation [#4706](https://github.com/Project-OSRM/osrm-backend/pull/4706)

View File

@ -27,7 +27,8 @@ struct URLParser final : qi::grammar<Iterator, Into>
using boost::spirit::repository::qi::iter_pos;
alpha_numeral = qi::char_("a-zA-Z0-9");
percent_encoding = qi::char_('%') > qi::uint_parser<char, 16, 2, 2>()[qi::_val = qi::_1];
percent_encoding =
qi::char_('%') > qi::uint_parser<unsigned char, 16, 2, 2>()[qi::_val = qi::_1];
polyline_chars = qi::char_("a-zA-Z0-9_.--[]{}@?|\\~`^") | percent_encoding;
all_chars = polyline_chars | qi::char_("=,;:&().");