Skip to content

Commit c2d5bc6

Browse files
rgw: Add coverity uninitialized variable and initialize RGWMetadataHandlerPut_SObj correctly
Signed-off-by: Vedansh Bhartia <[email protected]>
1 parent 5f1dece commit c2d5bc6

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
@@ -1662,7 +1662,7 @@ class RGWMetadataHandlerPut_Bucket : public RGWMetadataHandlerPut_SObj
16621662
RGWSI_MetaBackend_Handler::Op *op, string& entry,
16631663
RGWMetadataObject *_obj, RGWObjVersionTracker& objv_tracker,
16641664
optional_yield y,
1665-
RGWMDLogSyncType type, bool from_remote_zone) : RGWMetadataHandlerPut_SObj(_handler, op, entry, obj, objv_tracker, y, type, from_remote_zone),
1665+
RGWMDLogSyncType type, bool from_remote_zone) : RGWMetadataHandlerPut_SObj(_handler, op, entry, _obj, objv_tracker, y, type, from_remote_zone),
16661666
bhandler(_handler) {
16671667
obj = static_cast<RGWBucketEntryMetadataObject *>(_obj);
16681668
}

src/rgw/rgw_kmip_client_impl.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ RGWKMIPManagerImpl::add_request(RGWKMIPTransceiver *req)
420420
return -ECANCELED;
421421
// requests is a boost::intrusive::list, which manages pointers and does not copy the instance
422422
// coverity[leaked_storage:SUPPRESS]
423+
// coverity[uninit_use_in_call:SUPPRESS]
423424
requests.push_back(*new Request{*req});
424425
l.unlock();
425426
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)