diff options
author | Jacob Keeler <jacob.keeler@livioradio.com> | 2018-09-28 11:45:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-28 11:45:50 -0400 |
commit | 8b15bb1a05d7d287f3e9c5575af3c15a20936c15 (patch) | |
tree | 3636c29c2b8e29821878f6ad6878b1a969b30909 | |
parent | 461f76b129e998d4b60540491684c348dd5c27e2 (diff) | |
parent | 0c32601453970fa16798d3d917b360c0a8ac3c02 (diff) | |
download | sdl_core-8b15bb1a05d7d287f3e9c5575af3c15a20936c15.tar.gz |
Merge pull request #2641 from smartdevicelink/fix/coverity_fixes_5.0.0
More Coverity fixes for 5.0.0
12 files changed, 37 insertions, 23 deletions
diff --git a/src/components/application_manager/include/application_manager/request_info.h b/src/components/application_manager/include/application_manager/request_info.h index 57b6986af0..da1bd0a2ee 100644 --- a/src/components/application_manager/include/application_manager/request_info.h +++ b/src/components/application_manager/include/application_manager/request_info.h @@ -60,7 +60,7 @@ struct RequestInfo { RequestInfo() : timeout_msec_(0) , app_id_(0) - , requst_type_(RequestNone) + , request_type_(RequestNone) , correlation_id_(0) { start_time_ = date_time::getCurrentTime(); updateEndTime(); @@ -68,16 +68,19 @@ struct RequestInfo { virtual ~RequestInfo() {} RequestInfo(RequestPtr request, - const RequestType requst_type, + const RequestType request_type, const uint64_t timeout_msec) - : request_(request), timeout_msec_(timeout_msec), correlation_id_(0) { + : request_(request) + , timeout_msec_(timeout_msec) + , app_id_(0) + , correlation_id_(0) { start_time_ = date_time::getCurrentTime(); updateEndTime(); - requst_type_ = requst_type; + request_type_ = request_type; } RequestInfo(RequestPtr request, - const RequestType requst_type, + const RequestType request_type, const date_time::TimeDuration& start_time, const uint64_t timeout_msec); @@ -111,8 +114,8 @@ struct RequestInfo { return app_id_; } - RequestType requst_type() const { - return requst_type_; + RequestType request_type() const { + return request_type_; } uint32_t requestId() { @@ -132,7 +135,7 @@ struct RequestInfo { uint64_t timeout_msec_; date_time::TimeDuration end_time_; uint32_t app_id_; - RequestType requst_type_; + RequestType request_type_; uint32_t correlation_id_; }; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc index 40249387a7..c24529d720 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc @@ -52,6 +52,7 @@ RCCommandRequest::RCCommandRequest( params.hmi_capabilities_, params.policy_handler_) , is_subscribed(false) + , auto_allowed_(false) , resource_allocation_manager_(params.resource_allocation_manager_) , interior_data_cache_(params.interior_data_cache_) , interior_data_manager_(params.interior_data_manager_) {} diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h index 4564858845..1ad1c07b2a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/mobile/create_interaction_choice_set_request.h @@ -128,7 +128,7 @@ class CreateInteractionChoiceSetRequest int32_t choice_set_id_; size_t expected_chs_count_; size_t received_chs_count_; - bool should_send_warnings; + bool should_send_warnings_; /** * @brief Flag for stop sending VR commands to HMI, in case one of responses diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc index cd1f95b93c..416f4f2085 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc @@ -63,6 +63,7 @@ CreateInteractionChoiceSetRequest::CreateInteractionChoiceSetRequest( , choice_set_id_(0) , expected_chs_count_(0) , received_chs_count_(0) + , should_send_warnings_(false) , error_from_hmi_(false) , is_timed_out_(false) {} @@ -80,7 +81,7 @@ void CreateInteractionChoiceSetRequest::Run() { SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } - should_send_warnings = false; + for (uint32_t i = 0; i < (*message_)[strings::msg_params][strings::choice_set].length(); ++i) { @@ -109,7 +110,7 @@ void CreateInteractionChoiceSetRequest::Run() { return; } else if (verification_result_image == Result::WARNINGS || verification_result_secondary_image == Result::WARNINGS) { - should_send_warnings = true; + should_send_warnings_ = true; break; } } @@ -465,7 +466,7 @@ void CreateInteractionChoiceSetRequest::DeleteChoices() { void CreateInteractionChoiceSetRequest::OnAllHMIResponsesReceived() { LOG4CXX_AUTO_TRACE(logger_); - if (!error_from_hmi_ && should_send_warnings) { + if (!error_from_hmi_ && should_send_warnings_) { SendResponse(true, mobile_apis::Result::WARNINGS, kInvalidImageWarningInfo); } else if (!error_from_hmi_) { SendResponse(true, mobile_apis::Result::SUCCESS); diff --git a/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc b/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc index bbd0011298..712b91afe7 100644 --- a/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc +++ b/src/components/application_manager/src/plugin_manager/rpc_plugin_manager_impl.cc @@ -54,6 +54,7 @@ RPCPluginPtr LoadPlugin(const std::string& full_plugin_path) { return RPCPluginPtr(); } RPCPlugin* plugin = create_plugin(); + dlclose(plugin_dll); return RPCPluginPtr(plugin); } diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller.cc index 28c773ffcb..315cf6fdf8 100644 --- a/src/components/application_manager/src/request_controller.cc +++ b/src/components/application_manager/src/request_controller.cc @@ -401,7 +401,7 @@ void RequestController::TimeoutThread() { LOG4CXX_DEBUG(logger_, "Timeout for " << (RequestInfo::HMIRequest == - probably_expired->requst_type() + probably_expired->request_type() ? "HMI" : "Mobile") << " request id: " << probably_expired->requestId() @@ -420,7 +420,7 @@ void RequestController::TimeoutThread() { LOG4CXX_INFO(logger_, "Timeout for " << (RequestInfo::HMIRequest == - probably_expired->requst_type() + probably_expired->request_type() ? "HMI" : "Mobile") << " request id: " << probably_expired->requestId() diff --git a/src/components/application_manager/src/request_info.cc b/src/components/application_manager/src/request_info.cc index 45e56c5f9e..cd99a42508 100644 --- a/src/components/application_manager/src/request_info.cc +++ b/src/components/application_manager/src/request_info.cc @@ -74,12 +74,12 @@ MobileRequestInfo::MobileRequestInfo(RequestPtr request, } RequestInfo::RequestInfo(RequestPtr request, - const RequestInfo::RequestType requst_type, + const RequestInfo::RequestType request_type, const date_time::TimeDuration& start_time, const uint64_t timeout_msec) : request_(request), start_time_(start_time), timeout_msec_(timeout_msec) { updateEndTime(); - requst_type_ = requst_type; + request_type_ = request_type; correlation_id_ = request_->correlation_id(); app_id_ = request_->connection_key(); } diff --git a/src/components/application_manager/src/system_time/system_time_handler_impl.cc b/src/components/application_manager/src/system_time/system_time_handler_impl.cc index 6ae6d3e901..27f0972c01 100644 --- a/src/components/application_manager/src/system_time/system_time_handler_impl.cc +++ b/src/components/application_manager/src/system_time/system_time_handler_impl.cc @@ -46,6 +46,7 @@ SystemTimeHandlerImpl::SystemTimeHandlerImpl( : event_engine::EventObserver(application_manager.event_dispatcher()) , utc_time_can_be_received_(false) , awaiting_get_system_time_(false) + , last_time_(0) , system_time_listener_(NULL) , app_manager_(application_manager) { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/test/request_info_test.cc b/src/components/application_manager/test/request_info_test.cc index 0d7e6c65ac..0abef44e9a 100644 --- a/src/components/application_manager/test/request_info_test.cc +++ b/src/components/application_manager/test/request_info_test.cc @@ -46,10 +46,10 @@ namespace application_manager_test { class TestRequestInfo : public request_info::RequestInfo { public: TestRequestInfo(request_info::RequestPtr request, - const RequestType requst_type, + const RequestType request_type, const date_time::TimeDuration& start_time, const uint64_t timeout_msec) - : RequestInfo(request, requst_type, start_time, timeout_msec) {} + : RequestInfo(request, request_type, start_time, timeout_msec) {} void SetEndTime(const date_time::TimeDuration& end_time) { end_time_ = end_time; } @@ -77,14 +77,14 @@ class RequestInfoTest : public ::testing::Test { std::shared_ptr<TestRequestInfo> CreateTestInfo( uint32_t connection_key, uint32_t correlation_id, - request_info::RequestInfo::RequestType requst_type, + request_info::RequestInfo::RequestType request_type, const date_time::TimeDuration& start_time, uint64_t timeout_msec) { std::shared_ptr<MockRequest> mock_request = std::make_shared<MockRequest>(connection_key, correlation_id); std::shared_ptr<TestRequestInfo> request = std::make_shared<TestRequestInfo>( - mock_request, requst_type, start_time, timeout_msec); + mock_request, request_type, start_time, timeout_msec); return request; } }; diff --git a/src/components/include/security_manager/ssl_context.h b/src/components/include/security_manager/ssl_context.h index 9d66e1af2f..7d52c72abe 100644 --- a/src/components/include/security_manager/ssl_context.h +++ b/src/components/include/security_manager/ssl_context.h @@ -77,7 +77,8 @@ class SSLContext { }; struct HandshakeContext { - HandshakeContext() : expected_sn(""), expected_cn("") {} + HandshakeContext() + : expected_sn(""), expected_cn(""), system_time(time(NULL)) {} HandshakeContext(const custom_str::CustomString& exp_sn, const custom_str::CustomString& exp_cn) diff --git a/src/components/transport_manager/include/transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h b/src/components/transport_manager/include/transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h index a7338b94be..bb60b09a9d 100644 --- a/src/components/transport_manager/include/transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h +++ b/src/components/transport_manager/include/transport_manager/tcp/platform_specific/linux/platform_specific_network_interface_listener_impl.h @@ -22,7 +22,12 @@ class TcpClientListener; */ class InterfaceStatus { public: - InterfaceStatus() : flags_(0), has_ipv4_(false), has_ipv6_(false) {} + InterfaceStatus() + : flags_(0) + , has_ipv4_(false) + , has_ipv6_(false) + , ipv4_address_() + , ipv6_address_() {} ~InterfaceStatus() {} bool IsAvailable() const; @@ -132,7 +137,7 @@ class PlatformSpecificNetworkInterfaceListener struct sockaddr_storage address; EventParam(int interface_index, unsigned int interface_flags = 0) - : if_index(interface_index), flags(interface_flags) {} + : if_index(interface_index), flags(interface_flags), address() {} }; // parent class which we will notify the events to diff --git a/tools/intergen/model/src/model/composite_type.cc b/tools/intergen/model/src/model/composite_type.cc index 57e89cce54..d4b0687c5a 100644 --- a/tools/intergen/model/src/model/composite_type.cc +++ b/tools/intergen/model/src/model/composite_type.cc @@ -332,6 +332,7 @@ bool NullableType::operator<(const NullableType& that) const { if (type_ != that.type_) { return type_ < that.type_; } + return false; } TypeCodeGenerator* NullableType::Apply( |