From: amitkuma Date: Wed, 9 Aug 2017 10:26:30 +0000 (+0530) Subject: rgw: Initialization of members rgw_sync, rgw_rados X-Git-Tag: v15.1.0~2768^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ed39f3cb350e98c4f29ad2e13b2e43f93b60f745;p=ceph-ci.git rgw: Initialization of members rgw_sync, rgw_rados Fixes the coverity issues: ** 1355581 Uninitialized scalar field CID 1355581 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR) 2. uninit_member: Non-static class member cur_shard is not initialized in this constructor nor in any functions that it calls. ** 1356907 Uninitialized scalar field 2. uninit_member: Non-static class member field mtime.tv_sec is not initialized in this constructor nor in any functions that it calls. CID 1356907 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR) 4. uninit_member: Non-static class member field mtime.tv_nsec is not initialized in this constructor nor in any functions that it calls Signed-off-by: Amit Kumar amitkuma@redhat.com --- diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index a356a456b4d..bf538133b2b 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -2855,7 +2855,7 @@ public: RGWObjManifest manifest; bool has_manifest; uint64_t size; - struct timespec mtime; + struct timespec mtime {}; map attrs; Result() : has_manifest(false), size(0) {} diff --git a/src/rgw/rgw_sync.h b/src/rgw/rgw_sync.h index c651f7a9ad1..b684f9fc765 100644 --- a/src/rgw/rgw_sync.h +++ b/src/rgw/rgw_sync.h @@ -437,7 +437,7 @@ public: }; class RGWShardCollectCR : public RGWCoroutine { - int cur_shard; + int cur_shard = 0; int current_running; int max_concurrent; int status;