mirror of https://gitee.com/bigwinds/arangodb
fixed invalid read
This commit is contained in:
parent
df808cd665
commit
62718e0962
|
@ -125,12 +125,11 @@ class GeneralResponse {
|
||||||
|
|
||||||
// generates the response body, sets the content type; this might
|
// generates the response body, sets the content type; this might
|
||||||
// throw an error
|
// throw an error
|
||||||
void setPayload(VPackSlice&& slice, bool generateBody,
|
void setPayload(VPackSlice slice, bool generateBody,
|
||||||
VPackOptions const& options = VPackOptions::Options::Defaults,
|
VPackOptions const& options = VPackOptions::Options::Defaults,
|
||||||
bool resolveExternals = true) {
|
bool resolveExternals = true) {
|
||||||
_generateBody = generateBody;
|
_generateBody = generateBody;
|
||||||
auto tmp = std::move(slice);
|
addPayload(slice, &options, resolveExternals);
|
||||||
addPayload(tmp, &options, resolveExternals);
|
|
||||||
}
|
}
|
||||||
// Payload needs to be of type: VPackSlice const&
|
// Payload needs to be of type: VPackSlice const&
|
||||||
// or VPackBuffer<uint8_t>&&
|
// or VPackBuffer<uint8_t>&&
|
||||||
|
|
|
@ -305,10 +305,11 @@ void HttpResponse::addPayloadPostHook(
|
||||||
VPackOptions const* options = &VPackOptions::Options::Defaults,
|
VPackOptions const* options = &VPackOptions::Options::Defaults,
|
||||||
bool resolveExternals = true, bool bodySkipped = false) {
|
bool resolveExternals = true, bool bodySkipped = false) {
|
||||||
VPackSlice const* slicePtr;
|
VPackSlice const* slicePtr;
|
||||||
|
VPackSlice tmpSlice;
|
||||||
if (!bodySkipped) {
|
if (!bodySkipped) {
|
||||||
// we have Probably resolved externals
|
// we have Probably resolved externals
|
||||||
TRI_ASSERT(!_vpackPayloads.empty());
|
TRI_ASSERT(!_vpackPayloads.empty());
|
||||||
VPackSlice tmpSlice = VPackSlice(_vpackPayloads.front().data());
|
tmpSlice = VPackSlice(_vpackPayloads.front().data());
|
||||||
slicePtr = &tmpSlice;
|
slicePtr = &tmpSlice;
|
||||||
} else {
|
} else {
|
||||||
slicePtr = &slice;
|
slicePtr = &slice;
|
||||||
|
|
Loading…
Reference in New Issue