]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code: initialize all data members 3705/head 3707/head
authorLoic Dachary <ldachary@redhat.com>
Wed, 11 Feb 2015 20:48:34 +0000 (21:48 +0100)
committerLoic Dachary <ldachary@redhat.com>
Wed, 11 Feb 2015 21:45:49 +0000 (22:45 +0100)
As a safeguard against unitialized memory in isa and jerasure
plugins. Since the init method is supposed to be called before the
plugin is used, it is mostly not relevant. However it can lead to
problems that are non trivial to figure out.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/erasure-code/isa/ErasureCodeIsa.h
src/erasure-code/jerasure/ErasureCodeJerasure.h

index 118f8c0581e70f7e47de4fc31a9f17abbdbb2ad2..fe71c7a4a8437b6d01e7f27b3744d3fda71fd3ce 100644 (file)
@@ -51,6 +51,9 @@ public:
 
   ErasureCodeIsa(const char *_technique,
                  ErasureCodeIsaTableCache &_tcache) :
+  k(0),
+  m(0),
+  w(0),
   tcache(_tcache),
   technique(_technique),
   ruleset_root("default"),
index d40a03dec88ec0e611f2cc3a0d7735f95a56c596..b7a235843a261957ffcb2da3667bfa757cb25f78 100644 (file)
@@ -34,8 +34,11 @@ public:
   bool per_chunk_alignment;
 
   ErasureCodeJerasure(const char *_technique) :
+    k(0),
     DEFAULT_K(2),
+    m(0),
     DEFAULT_M(1),
+    w(0),
     DEFAULT_W(8),
     technique(_technique),
     ruleset_root("default"),