From ed39f3cb350e98c4f29ad2e13b2e43f93b60f745 Mon Sep 17 00:00:00 2001 From: amitkuma Date: Wed, 9 Aug 2017 15:56:30 +0530 Subject: [PATCH] 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 --- src/rgw/rgw_rados.h | 2 +- src/rgw/rgw_sync.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; -- 2.39.5