From: Loic Dachary Date: Wed, 11 Feb 2015 20:48:34 +0000 (+0100) Subject: erasure-code: initialize all data members X-Git-Tag: v0.93~48^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b24a01b50a98fa1e3519f47c7f29136dee5c9469;p=ceph.git erasure-code: initialize all data members 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 --- diff --git a/src/erasure-code/isa/ErasureCodeIsa.h b/src/erasure-code/isa/ErasureCodeIsa.h index 118f8c0581e7..fe71c7a4a843 100644 --- a/src/erasure-code/isa/ErasureCodeIsa.h +++ b/src/erasure-code/isa/ErasureCodeIsa.h @@ -51,6 +51,9 @@ public: ErasureCodeIsa(const char *_technique, ErasureCodeIsaTableCache &_tcache) : + k(0), + m(0), + w(0), tcache(_tcache), technique(_technique), ruleset_root("default"), diff --git a/src/erasure-code/jerasure/ErasureCodeJerasure.h b/src/erasure-code/jerasure/ErasureCodeJerasure.h index d40a03dec88e..b7a235843a26 100644 --- a/src/erasure-code/jerasure/ErasureCodeJerasure.h +++ b/src/erasure-code/jerasure/ErasureCodeJerasure.h @@ -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"),