diff options
author | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2013-05-13 14:36:53 +0200 |
---|---|---|
committer | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2013-05-14 18:39:31 +0200 |
commit | 8df55e0a8b03f8a38f6ba3118d86b94383c415a6 (patch) | |
tree | d1468a7abc1b19d5999f31148787f53cf4a74352 | |
parent | eac545e12cff6203bc46e77142bb1be2f466bf9c (diff) | |
download | ceph-8df55e0a8b03f8a38f6ba3118d86b94383c415a6.tar.gz |
test/test_cors.cc: initialize key_type in constructor
CID 1019635 (#1 of 1): Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member "kt" is not initialized in
this constructor nor in any functions that it calls.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
-rw-r--r-- | src/test/test_cors.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/test/test_cors.cc b/src/test/test_cors.cc index 3c1203c8b4f..4d385bc037e 100644 --- a/src/test/test_cors.cc +++ b/src/test/test_cors.cc @@ -40,7 +40,8 @@ using namespace std; extern "C" int ceph_armor(char *dst, const char *dst_end, const char *src, const char *end); enum key_type { - KEY_TYPE_SWIFT = 1, + KEY_TYPE_UNDEFINED = 0, + KEY_TYPE_SWIFT, KEY_TYPE_S3 }; @@ -65,7 +66,7 @@ class test_cors_helper { unsigned resp_code; key_type kt; public: - test_cors_helper() : resp_data(NULL){ + test_cors_helper() : resp_data(NULL), kt(KEY_TYPE_UNDEFINED){ curl_global_init(CURL_GLOBAL_ALL); } ~test_cors_helper(){ @@ -247,8 +248,11 @@ int test_cors_helper::send_request(string method, string res, string s3auth; if(get_s3_auth(method, creds, date, res, s3auth) < 0)return -1; auth.append(string("Authorization: AWS ") + s3auth); - }else if(kt == KEY_TYPE_SWIFT){ + } else if(kt == KEY_TYPE_SWIFT){ auth.append(string("X-Auth-Token: ") + creds); + } else { + cout << "Unknown state (" << kt << ")\n"; + return -1; } struct curl_slist *slist = NULL; |