From 3a064dcfb7a96a8a8b20444edb3bc0f4cbc35e54 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 30 Nov 2012 21:41:54 -0800 Subject: [PATCH] rgw: fix uninit var CID 745935 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR) At (2): Non-static class member "expiration" is not initialized in this constructor nor in any functions that it calls. At (2): Non-static class member "min_len" is not initialized in this constructor nor in any functions that it calls. At (4): Non-static class member "max_len" is not initialized in this constructor nor in any functions that it calls. At (6): Non-static class member "ret" is not initialized in this constructor nor in any functions that it calls. At (8): Non-static class member "len" is not initialized in this constructor nor in any functions that it calls. At (10): Non-static class member "ofs" is not initialized in this constructor nor in any functions that it calls. At (12): Non-static class member "supplied_md5_b64" is not initialized in this constructor nor in any functions that it calls. At (14): Non-static class member "supplied_etag" is not initialized in this constructor nor in any functions that it calls. CID 745934 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR) At (16): Non-static class member "data_pending" is not initialized in this constructor nor in any functions that it calls. Signed-off-by: Sage Weil --- src/rgw/rgw_op.h | 14 +++----------- src/rgw/rgw_swift.h | 2 +- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h index 043bad03f3fbb..652e9c050dc44 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -337,20 +337,12 @@ protected: map attrs; public: - RGWPostObj() {} + RGWPostObj() : min_len(0), max_len(LLONG_MAX), ret(0), len(0), ofs(0), + supplied_md5_b64(NULL), supplied_etag(NULL), + data_pending(false) {} virtual void init(RGWRados *store, struct req_state *s, RGWHandler *h) { RGWOp::init(store, s, h); - min_len = 0; - max_len = LLONG_MAX; - ret = 0; - len = 0; - ofs = 0; - supplied_md5_b64 = NULL; - supplied_etag = NULL; - etag = ""; - boundary = ""; - data_pending = false; policy.set_ctx(s->cct); } diff --git a/src/rgw/rgw_swift.h b/src/rgw/rgw_swift.h index bdca5b46283e6..6c5024e1a54c5 100644 --- a/src/rgw/rgw_swift.h +++ b/src/rgw/rgw_swift.h @@ -26,7 +26,7 @@ public: map roles; - KeystoneToken() {} + KeystoneToken() : expiration(0) {} int parse(CephContext *cct, bufferlist& bl); -- 2.39.5