diff --git a/boost/network/protocol/http/client/connection/async_normal.hpp b/boost/network/protocol/http/client/connection/async_normal.hpp index 355ead023..75a76037f 100644 --- a/boost/network/protocol/http/client/connection/async_normal.hpp +++ b/boost/network/protocol/http/client/connection/async_normal.hpp @@ -30,6 +30,7 @@ #include #include #include +#include #include namespace boost { @@ -477,8 +478,10 @@ struct http_async_connection if (this->is_chunk_encoding && remove_chunk_markers_) { for (size_t i = 0; i < this->partial_parsed.size(); i += 1024) { auto range = parse_chunk_encoding(boost::make_iterator_range( - this->partial_parsed.data() + i, - this->partial_parsed.data() + + static_cast::type, 1024>::const_iterator>( + this->partial_parsed.data()) + i, + static_cast::type, 1024>::const_iterator>( + this->partial_parsed.data()) + std::min(i + 1024, this->partial_parsed.size()))); body_string.append(boost::begin(range), boost::end(range)); }