Skip to content

Commit d05fa0b

Browse files
authored
Merge pull request ceph#52254 from vedanshbhartia/coverity_uninit
rgw: Add coverity uninitialized variable and initialize RGWBucketEntryMetadataObject reviewed-by: yuvalif
2 parents 94d69a1 + c2d5bc6 commit d05fa0b

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/rgw/driver/rados/rgw_bucket.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2065,7 +2065,7 @@ class RGWMetadataHandlerPut_Bucket : public RGWMetadataHandlerPut_SObj
20652065
RGWSI_MetaBackend_Handler::Op *op, string& entry,
20662066
RGWMetadataObject *_obj, RGWObjVersionTracker& objv_tracker,
20672067
optional_yield y,
2068-
RGWMDLogSyncType type, bool from_remote_zone) : RGWMetadataHandlerPut_SObj(_handler, op, entry, obj, objv_tracker, y, type, from_remote_zone),
2068+
RGWMDLogSyncType type, bool from_remote_zone) : RGWMetadataHandlerPut_SObj(_handler, op, entry, _obj, objv_tracker, y, type, from_remote_zone),
20692069
bhandler(_handler) {
20702070
obj = static_cast<RGWBucketEntryMetadataObject *>(_obj);
20712071
}

src/rgw/rgw_kmip_client_impl.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ RGWKMIPManagerImpl::add_request(RGWKMIPTransceiver *req)
416416
return -ECANCELED;
417417
// requests is a boost::intrusive::list, which manages pointers and does not copy the instance
418418
// coverity[leaked_storage:SUPPRESS]
419+
// coverity[uninit_use_in_call:SUPPRESS]
419420
requests.push_back(*new Request{*req});
420421
l.unlock();
421422
if (worker)

src/rgw/rgw_rest_conn.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ int RGWRESTConn::forward_iam_request(const DoutPrefixProvider *dpp, const RGWAcc
124124
}
125125
std::string service = "iam";
126126
RGWRESTSimpleRequest req(cct, info.method, url, NULL, &params, api_name);
127+
// coverity[uninit_use_in_call:SUPPRESS]
127128
return req.forward_request(dpp, key, info, max_response, inbl, outbl, y, service);
128129
}
129130

@@ -143,6 +144,7 @@ int RGWRESTConn::put_obj_send_init(const rgw_obj& obj, const rgw_http_param_pair
143144
}
144145

145146
RGWRESTStreamS3PutObj *wr = new RGWRESTStreamS3PutObj(cct, "PUT", url, NULL, &params, api_name, host_style);
147+
// coverity[uninit_use_in_call:SUPPRESS]
146148
wr->send_init(obj);
147149
*req = wr;
148150
return 0;
@@ -160,6 +162,7 @@ int RGWRESTConn::put_obj_async_init(const DoutPrefixProvider *dpp, const rgw_use
160162
param_vec_t params;
161163
populate_params(params, &uid, self_zone_group);
162164
RGWRESTStreamS3PutObj *wr = new RGWRESTStreamS3PutObj(cct, "PUT", url, NULL, &params, api_name, host_style);
165+
// coverity[uninit_use_in_call:SUPPRESS]
163166
wr->put_obj_init(dpp, key, obj, attrs);
164167
*req = wr;
165168
return 0;
@@ -290,6 +293,7 @@ int RGWRESTConn::get_obj(const DoutPrefixProvider *dpp, const rgw_obj& obj, cons
290293
set_header(buf, extra_headers, "RANGE");
291294
}
292295

296+
// coverity[uninit_use_in_call:SUPPRESS]
293297
int r = (*req)->send_prepare(dpp, key, extra_headers, obj);
294298
if (r < 0) {
295299
goto done_err;

0 commit comments

Comments
 (0)