From: Vedansh Bhartia Date: Wed, 7 Jun 2023 15:41:53 +0000 (+0530) Subject: rgw: Add coverity uninitialized variable and initialize RGWMetadataHandlerPut_SObj... X-Git-Tag: v19.0.0~311^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c2d5bc6981f015f568413acebab3add84a938078;p=ceph-ci.git rgw: Add coverity uninitialized variable and initialize RGWMetadataHandlerPut_SObj correctly Signed-off-by: Vedansh Bhartia --- diff --git a/src/rgw/driver/rados/rgw_bucket.cc b/src/rgw/driver/rados/rgw_bucket.cc index b1dd9fe1cda..73a68671784 100644 --- a/src/rgw/driver/rados/rgw_bucket.cc +++ b/src/rgw/driver/rados/rgw_bucket.cc @@ -1662,7 +1662,7 @@ public: RGWSI_MetaBackend_Handler::Op *op, string& entry, RGWMetadataObject *_obj, RGWObjVersionTracker& objv_tracker, optional_yield y, - RGWMDLogSyncType type, bool from_remote_zone) : RGWMetadataHandlerPut_SObj(_handler, op, entry, obj, objv_tracker, y, type, from_remote_zone), + RGWMDLogSyncType type, bool from_remote_zone) : RGWMetadataHandlerPut_SObj(_handler, op, entry, _obj, objv_tracker, y, type, from_remote_zone), bhandler(_handler) { obj = static_cast(_obj); } diff --git a/src/rgw/rgw_kmip_client_impl.cc b/src/rgw/rgw_kmip_client_impl.cc index b7f4f38e620..bee3c0ae11d 100644 --- a/src/rgw/rgw_kmip_client_impl.cc +++ b/src/rgw/rgw_kmip_client_impl.cc @@ -420,6 +420,7 @@ RGWKMIPManagerImpl::add_request(RGWKMIPTransceiver *req) return -ECANCELED; // requests is a boost::intrusive::list, which manages pointers and does not copy the instance // coverity[leaked_storage:SUPPRESS] + // coverity[uninit_use_in_call:SUPPRESS] requests.push_back(*new Request{*req}); l.unlock(); if (worker) diff --git a/src/rgw/rgw_rest_conn.cc b/src/rgw/rgw_rest_conn.cc index ffb536ed977..44663078d28 100644 --- a/src/rgw/rgw_rest_conn.cc +++ b/src/rgw/rgw_rest_conn.cc @@ -124,6 +124,7 @@ int RGWRESTConn::forward_iam_request(const DoutPrefixProvider *dpp, const RGWAcc } std::string service = "iam"; RGWRESTSimpleRequest req(cct, info.method, url, NULL, ¶ms, api_name); + // coverity[uninit_use_in_call:SUPPRESS] return req.forward_request(dpp, key, info, max_response, inbl, outbl, y, service); } @@ -143,6 +144,7 @@ int RGWRESTConn::put_obj_send_init(const rgw_obj& obj, const rgw_http_param_pair } RGWRESTStreamS3PutObj *wr = new RGWRESTStreamS3PutObj(cct, "PUT", url, NULL, ¶ms, api_name, host_style); + // coverity[uninit_use_in_call:SUPPRESS] wr->send_init(obj); *req = wr; return 0; @@ -160,6 +162,7 @@ int RGWRESTConn::put_obj_async_init(const DoutPrefixProvider *dpp, const rgw_use param_vec_t params; populate_params(params, &uid, self_zone_group); RGWRESTStreamS3PutObj *wr = new RGWRESTStreamS3PutObj(cct, "PUT", url, NULL, ¶ms, api_name, host_style); + // coverity[uninit_use_in_call:SUPPRESS] wr->put_obj_init(dpp, key, obj, attrs); *req = wr; return 0; @@ -290,6 +293,7 @@ int RGWRESTConn::get_obj(const DoutPrefixProvider *dpp, const rgw_obj& obj, cons set_header(buf, extra_headers, "RANGE"); } + // coverity[uninit_use_in_call:SUPPRESS] int r = (*req)->send_prepare(dpp, key, extra_headers, obj); if (r < 0) { goto done_err;