]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Initializes uninitialized members of rgw 16855/head
authoramitkuma <amitkuma@redhat.com>
Mon, 7 Aug 2017 10:59:01 +0000 (16:29 +0530)
committeramitkuma <amitkuma@redhat.com>
Thu, 31 Aug 2017 14:24:45 +0000 (19:54 +0530)
Fixes the coverity issues:

** 1352181 Uninitialized scalar field
2. uninit_member: Non-static class member field fh_hk.bucket is
not initialized in this constructor nor in any functions that it calls.
CID 1352181 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
4. uninit_member: Non-static class member field fh_hk.object is
not initialized in this constructor nor in any functions that it calls.

** 1353424 Uninitialized scalar field
CID 1353424 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
5. uninit_member: Non-static class member watch_handle is not initialized
 in this constructor nor in any functions that it calls.

** 1355240 Uninitialized scalar field
CID 1355240 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
2. uninit_member: Non-static class member index_type is not initialized
in this constructor nor in any functions that it calls.

Signed-off-by: Amit Kumar <amitkuma@redhat.com>
src/rgw/rgw_common.h
src/rgw/rgw_file.h
src/rgw/rgw_realm_watcher.h

index 6dcdde5be0c38a229836c45247c5bc23b464558e..bc87dc567c0e7747fe88b4e3580e66801657705e 100644 (file)
@@ -1197,7 +1197,7 @@ struct RGWBucketInfo
   bool has_website;
   RGWBucketWebsiteConf website_conf;
 
-  RGWBucketIndexType index_type;
+  RGWBucketIndexType index_type = RGWBIType_Normal;
 
   bool swift_versioning;
   string swift_ver_location;
index 34f3f0bcec8616ab4e6911b1a03138eff50a492b..5434f6a54a8aee9460d63f5ee45b97598af982ef 100644 (file)
@@ -91,7 +91,7 @@ namespace rgw {
    */
   struct fh_key
   {
-    rgw_fh_hk fh_hk;
+    rgw_fh_hk fh_hk {};
     uint32_t version;
 
     static constexpr uint64_t seed = 8675309;
index 5c1240bbb4ffad0292d3ce62d0be4554be7a402a..7ef40f458a0d6cde06be3f5c3e183579124eb912 100644 (file)
@@ -56,7 +56,7 @@ class RGWRealmWatcher : public librados::WatchCtx2 {
   /// so that we don't miss notifications during realm reconfiguration
   librados::Rados rados;
   librados::IoCtx pool_ctx;
-  uint64_t watch_handle;
+  uint64_t watch_handle = 0;
   std::string watch_oid;
 
   int watch_start(RGWRealm& realm);