From 4517e03d3b8be2249d62b8445be7c66ccd1fb2f3 Mon Sep 17 00:00:00 2001 From: amitkuma Date: Wed, 9 Aug 2017 18:24:47 +0530 Subject: [PATCH] rgw: Intializing is_master, max_aio Fixes the coverity issue: ** 1396142 Uninitialized scalar field CID 1396142 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR) 2. uninit_member: Non-static class member max_aio is not initialized in this constructor nor in any functions that it calls. ** 1396205 Uninitialized scalar field CID 1396205 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR) 2. uninit_member: Non-static class member is_master is not initialized in this constructor nor in any functions that it calls. ** 1396150 Uninitialized scalar field CID 1396150 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR) 2. uninit_member: Non-static class member size is not initialized in this constructor nor in any functions that it calls. Signed-off-by: Amit Kumar amitkuma@redhat.com --- src/rgw/rgw_bucket.h | 2 +- src/rgw/rgw_rados.h | 2 +- src/rgw/rgw_sync_module.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_bucket.h b/src/rgw/rgw_bucket.h index 6cc20eb8f61..e0c9bb5c969 100644 --- a/src/rgw/rgw_bucket.h +++ b/src/rgw/rgw_bucket.h @@ -199,7 +199,7 @@ struct RGWBucketAdminOpState { bool fix_index; bool delete_child_objects; bool bucket_stored; - int max_aio; + int max_aio = 0; rgw_bucket bucket; diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index a356a456b4d..da1173c8aec 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -1450,7 +1450,7 @@ WRITE_CLASS_ENCODER(RGWZoneGroupPlacementTarget) struct RGWZoneGroup : public RGWSystemMetaObj { string api_name; list endpoints; - bool is_master; + bool is_master = false; string master_zone; map zones; diff --git a/src/rgw/rgw_sync_module.h b/src/rgw/rgw_sync_module.h index 278d1df3893..cab2eb5d9bb 100644 --- a/src/rgw/rgw_sync_module.h +++ b/src/rgw/rgw_sync_module.h @@ -109,7 +109,7 @@ protected: rgw_obj_key key; ceph::real_time mtime; - uint64_t size; + uint64_t size = 0; map attrs; public: RGWStatRemoteObjCBCR(RGWDataSyncEnv *_sync_env, -- 2.39.5