Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix boost::network::uri::decode error - out of range because of '%'
  • Loading branch information
cnagune committed Aug 13, 2015
commit be97dfedbeb000a9c85904dbf994786ca56cba72
6 changes: 6 additions & 0 deletions boost/network/uri/decode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,14 @@ OutputIterator decode(const InputIterator &in_begin,
while (it != in_end) {
if (*it == '%') {
++it;
if (it == in_end) {
throw std::runtime_error("decoding fail because of '%'");
}
value_type v0 = detail::letter_to_hex(*it);
++it;
if (it == in_end) {
throw std::runtime_error("decoding fail because of '%'");
}
value_type v1 = detail::letter_to_hex(*it);
++it;
*out++ = 0x10 * v0 + v1;
Expand Down