Fix a bug on COW of the std::string class
This commit is contained in:
parent
951e179e24
commit
6b854ffe6f
|
@ -376,7 +376,7 @@ std::shared_ptr<std::string> HttpResponseImpl::renderToString() const
|
|||
{
|
||||
std::lock_guard<std::mutex> lock(*_httpStringMutex);
|
||||
_httpString = std::make_shared<std::string>(*_httpString);
|
||||
memcpy((void *)(_httpString->data() + _datePos), newDate, strlen(newDate));
|
||||
memcpy((void *)&(*_httpString)[_datePos], newDate, strlen(newDate));
|
||||
return _httpString;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue