Copy data to beginning of buffer, not end. (#2542)

Copy data to beginning of buffer, not end.
This commit is contained in:
Daniel Patterson 2016-06-13 12:59:42 -07:00 committed by GitHub
parent 0fc823041e
commit 494845b160
2 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,7 @@
# 5.2.2
- Bugfix
- buffer overrun in tile plugin response handling
# 5.2.0
Changes form 5.2.0 RC2
- Bugfixes:

View File

@ -105,11 +105,10 @@ void RequestHandler::HandleRequest(const http::request &current_request, http::r
else
{
BOOST_ASSERT(result.is<std::string>());
current_reply.content.resize(current_reply.content.size() +
result.get<std::string>().size());
current_reply.content.resize(result.get<std::string>().size());
std::copy(result.get<std::string>().cbegin(),
result.get<std::string>().cend(),
current_reply.content.end());
current_reply.content.begin());
current_reply.headers.emplace_back("Content-Type", "application/x-protobuf");
}