]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: Initialization of members rgw_sync, rgw_rados
authoramitkuma <amitkuma@redhat.com>
Wed, 9 Aug 2017 10:26:30 +0000 (15:56 +0530)
committeramitkuma <amitkuma@redhat.com>
Wed, 9 Aug 2017 10:26:30 +0000 (15:56 +0530)
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
src/rgw/rgw_sync.h

index a356a456b4d137de4fa18ae4ff7e7cd4465356b6..bf538133b2bff5c1358e7c17f2d3338e45959cc1 100644 (file)
@@ -2855,7 +2855,7 @@ public:
         RGWObjManifest manifest;
         bool has_manifest;
         uint64_t size;
-       struct timespec mtime;
+       struct timespec mtime {};
         map<string, bufferlist> attrs;
 
         Result() : has_manifest(false), size(0) {}
index c651f7a9ad1b98191a44207db7beadf543079417..b684f9fc765659c2526fccc883120179780052b9 100644 (file)
@@ -437,7 +437,7 @@ public:
 };
 
 class RGWShardCollectCR : public RGWCoroutine {
-  int cur_shard;
+  int cur_shard = 0;
   int current_running;
   int max_concurrent;
   int status;