From aedb8d8ef646ed480296eb0a53513c74475cef08 Mon Sep 17 00:00:00 2001 From: Daniel Neus <daniel@neus-online.eu> Date: Tue, 22 Dec 2015 21:50:43 +0100 Subject: some trivial compiler/PVS-Studio warning fixes --- src/lib/cert/x509/x509_obj.cpp | 2 +- src/lib/cert/x509/x509path.cpp | 2 +- src/lib/stream/rc4/rc4.cpp | 2 +- src/lib/tls/msg_client_kex.cpp | 2 +- src/lib/utils/http_util/http_util.cpp | 1 - 5 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/lib') diff --git a/src/lib/cert/x509/x509_obj.cpp b/src/lib/cert/x509/x509_obj.cpp index 4dae68607..e908e8cab 100644 --- a/src/lib/cert/x509/x509_obj.cpp +++ b/src/lib/cert/x509/x509_obj.cpp @@ -201,7 +201,7 @@ bool X509_Object::check_signature(const Public_Key& pub_key) const return verifier.verify_message(tbs_data(), signature()); } - catch(std::exception& e) + catch(std::exception&) { return false; } diff --git a/src/lib/cert/x509/x509path.cpp b/src/lib/cert/x509/x509path.cpp index 7e54ad9f9..5e12ddb2a 100644 --- a/src/lib/cert/x509/x509path.cpp +++ b/src/lib/cert/x509/x509path.cpp @@ -170,7 +170,7 @@ check_chain(const std::vector<X509_Certificate>& cert_path, else if(ocsp_status == Certificate_Status_Code::OCSP_RESPONSE_GOOD) continue; } - catch(std::exception& e) + catch(std::exception&) { //std::cout << "OCSP error: " << e.what() << "\n"; } diff --git a/src/lib/stream/rc4/rc4.cpp b/src/lib/stream/rc4/rc4.cpp index 6146e2818..d94bf8164 100644 --- a/src/lib/stream/rc4/rc4.cpp +++ b/src/lib/stream/rc4/rc4.cpp @@ -111,6 +111,6 @@ void RC4::clear() /* * RC4 Constructor */ -RC4::RC4(size_t s) : SKIP(s), X(0), Y(0) {} +RC4::RC4(size_t s) : SKIP(s), X(0), Y(0), state(), buffer(), position(0) {} } diff --git a/src/lib/tls/msg_client_kex.cpp b/src/lib/tls/msg_client_kex.cpp index 7ce9b9df2..68809f22f 100644 --- a/src/lib/tls/msg_client_kex.cpp +++ b/src/lib/tls/msg_client_kex.cpp @@ -365,7 +365,7 @@ Client_Key_Exchange::Client_Key_Exchange(const std::vector<byte>& contents, else m_pre_master = shared_secret; } - catch(std::exception &e) + catch(std::exception &) { /* * Something failed in the DH computation. To avoid possible diff --git a/src/lib/utils/http_util/http_util.cpp b/src/lib/utils/http_util/http_util.cpp index 1f67c0b4b..6d4e7c8e8 100644 --- a/src/lib/utils/http_util/http_util.cpp +++ b/src/lib/utils/http_util/http_util.cpp @@ -98,7 +98,6 @@ Response http_sync(http_exch_fn http_transact, const auto protocol_host_sep = url.find("://"); if(protocol_host_sep == std::string::npos) throw Exception("Invalid URL " + url); - const std::string protocol = url.substr(0, protocol_host_sep); const auto host_loc_sep = url.find('/', protocol_host_sep + 3); -- cgit v1.2.3 From 8b7a31fbfcbbd47f34f4f4edad4d05f25a9d0ecd Mon Sep 17 00:00:00 2001 From: Daniel Neus <daniel@neus-online.eu> Date: Wed, 23 Dec 2015 12:34:24 +0100 Subject: initialize private members in rc4 header --- src/lib/stream/rc4/rc4.cpp | 2 +- src/lib/stream/rc4/rc4.h | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/lib') diff --git a/src/lib/stream/rc4/rc4.cpp b/src/lib/stream/rc4/rc4.cpp index d94bf8164..9a6268b8c 100644 --- a/src/lib/stream/rc4/rc4.cpp +++ b/src/lib/stream/rc4/rc4.cpp @@ -111,6 +111,6 @@ void RC4::clear() /* * RC4 Constructor */ -RC4::RC4(size_t s) : SKIP(s), X(0), Y(0), state(), buffer(), position(0) {} +RC4::RC4(size_t s) : SKIP(s) {} } diff --git a/src/lib/stream/rc4/rc4.h b/src/lib/stream/rc4/rc4.h index 60c9450b4..9c4b2717c 100644 --- a/src/lib/stream/rc4/rc4.h +++ b/src/lib/stream/rc4/rc4.h @@ -44,12 +44,11 @@ class BOTAN_DLL RC4 : public StreamCipher void generate(); const size_t SKIP; - - byte X, Y; + byte X = 0; + byte Y = 0; secure_vector<byte> state; - secure_vector<byte> buffer; - size_t position; + size_t position = 0; }; } -- cgit v1.2.3