Temp workaround for H_collections_get_cid segfault due to NULL ext field in response
Tested-by: Build Bot
Tested-by: Ellis Breen
@@ -913,11 +913,17 @@ H_collections_get_cid(mc_PIPELINE *pipeline, mc_PACKET *request,
resp.rflags |= LCB_RESP_F_FINAL;
const char *ptr = response->ext();
+ if (ptr) {
memcpy(&resp.manifest_id, ptr, sizeof(uint64_t));
resp.manifest_id = lcb_ntohll(resp.manifest_id);
ptr += sizeof(uint64_t);
memcpy(&resp.collection_id, ptr, sizeof(uint32_t));
resp.collection_id = ntohl(resp.collection_id);
+ } else {
+ resp.manifest_id = 0;
+ resp.collection_id = 0;
+ resp.rc = LCB_NOT_SUPPORTED;
+ }
if (request->flags & MCREQ_F_REQEXT) {
request->u_rdata.exdata->procs->handler(pipeline, request, immerr, &resp);
