From fccaccbc8e66424778b2d14cb7cbcf56b139362a Mon Sep 17 00:00:00 2001 From: jpk68 Date: Wed, 5 Aug 2026 21:45:36 -0400 Subject: [PATCH] src: fix issues found through static analysis --- contrib/epee/include/net/network_throttle.hpp | 1 + src/crypto/jh.c | 1 - src/cryptonote_core/cryptonote_tx_utils.h | 8 -------- .../cryptonote_protocol_handler_common.h | 1 + src/device/device.hpp | 1 + src/device/device_io.hpp | 2 +- src/p2p/net_node_common.h | 1 + 7 files changed, 5 insertions(+), 10 deletions(-) diff --git a/contrib/epee/include/net/network_throttle.hpp b/contrib/epee/include/net/network_throttle.hpp index 1acb0c38f..d6d10cbbe 100644 --- a/contrib/epee/include/net/network_throttle.hpp +++ b/contrib/epee/include/net/network_throttle.hpp @@ -110,6 +110,7 @@ class network_throttle_manager { */ class i_network_throttle { public: + virtual ~i_network_throttle() = default; virtual void set_name(const std::string &name)=0; virtual void set_target_speed( network_speed_kbps target )=0; virtual network_speed_kbps get_target_speed()=0; diff --git a/src/crypto/jh.c b/src/crypto/jh.c index b156b3ae1..b4fa71512 100644 --- a/src/crypto/jh.c +++ b/src/crypto/jh.c @@ -97,7 +97,6 @@ static void F8(hashState *state); /*The compression function F8 */ static HashReturn Init(hashState *state, int hashbitlen); static HashReturn Update(hashState *state, const BitSequence *data, DataLength databitlen); static HashReturn Final(hashState *state, BitSequence *hashval); -HashReturn jh_hash(int hashbitlen, const BitSequence *data,DataLength databitlen, BitSequence *hashval); /*swapping bit 2i with bit 2i+1 of 64-bit x*/ #define SWAP1(x) (x) = ((((x) & 0x5555555555555555ULL) << 1) | (((x) & 0xaaaaaaaaaaaaaaaaULL) >> 1)); diff --git a/src/cryptonote_core/cryptonote_tx_utils.h b/src/cryptonote_core/cryptonote_tx_utils.h index 2f305d9aa..e8c0f6627 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.h +++ b/src/cryptonote_core/cryptonote_tx_utils.h @@ -130,14 +130,6 @@ namespace cryptonote crypto::public_key &out_eph_public_key, const bool use_view_tags, crypto::view_tag &view_tag) ; - bool generate_output_ephemeral_keys(const size_t tx_version, const cryptonote::account_keys &sender_account_keys, const crypto::public_key &txkey_pub, const crypto::secret_key &tx_key, - const cryptonote::tx_destination_entry &dst_entr, const boost::optional &change_addr, const size_t output_index, - const bool &need_additional_txkeys, const std::vector &additional_tx_keys, - std::vector &additional_tx_public_keys, - std::vector &amount_keys, - crypto::public_key &out_eph_public_key, - const bool use_view_tags, crypto::view_tag &view_tag) ; - bool generate_genesis_block( block& bl , std::string const & genesis_tx diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler_common.h b/src/cryptonote_protocol/cryptonote_protocol_handler_common.h index df9249ea3..df2355e68 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler_common.h +++ b/src/cryptonote_protocol/cryptonote_protocol_handler_common.h @@ -40,6 +40,7 @@ namespace cryptonote /************************************************************************/ struct i_cryptonote_protocol { + virtual ~i_cryptonote_protocol() = default; virtual bool is_synchronized() const = 0; virtual bool relay_block(NOTIFY_NEW_FLUFFY_BLOCK::request& arg, cryptonote_connection_context& exclude_context)=0; virtual bool relay_transactions(NOTIFY_NEW_TRANSACTIONS::request& arg, const boost::uuids::uuid& source, epee::net_utils::zone zone, relay_method tx_relay)=0; diff --git a/src/device/device.hpp b/src/device/device.hpp index 81caec91b..236532078 100644 --- a/src/device/device.hpp +++ b/src/device/device.hpp @@ -70,6 +70,7 @@ namespace hw { class device_progress { public: + virtual ~device_progress() = default; virtual double progress() const { return 0; } virtual bool indeterminate() const { return false; } }; diff --git a/src/device/device_io.hpp b/src/device/device_io.hpp index c24fa29fd..cb83cbe62 100644 --- a/src/device/device_io.hpp +++ b/src/device/device_io.hpp @@ -41,7 +41,7 @@ namespace hw { public: device_io() {}; - ~device_io() {}; + virtual ~device_io() = default; virtual void init() = 0; virtual void release() = 0; diff --git a/src/p2p/net_node_common.h b/src/p2p/net_node_common.h index 625259eb1..0c45cf0a4 100644 --- a/src/p2p/net_node_common.h +++ b/src/p2p/net_node_common.h @@ -52,6 +52,7 @@ namespace nodetool template struct i_p2p_endpoint { + virtual ~i_p2p_endpoint() = default; virtual bool relay_notify_to_list(int command, epee::levin::message_writer message, std::vector> connections)=0; virtual epee::net_utils::zone send_txs(std::vector txs, const epee::net_utils::zone origin, const boost::uuids::uuid& source, cryptonote::relay_method tx_relay)=0; virtual bool invoke_notify_to_peer(int command, epee::levin::message_writer message, const epee::net_utils::connection_context_base& context)=0;