diff options
author | luigi1111 <luigi1111w@gmail.com> | 2019-06-11 17:22:11 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2019-06-11 17:22:11 -0500 |
commit | 538fae4ec29eb79fd11e569a21a4b334a5e94b75 (patch) | |
tree | cc19e574be53d22a2d0468d576be4a5060c501a8 /src | |
parent | Merge pull request #5622 (diff) | |
parent | cmake: do not use -mmitigate-rop on GCC >= 9.1 (diff) | |
download | monero-538fae4ec29eb79fd11e569a21a4b334a5e94b75.tar.xz |
Merge pull request #5614
4cff925 p2p: fix GCC 9.1 crash (monermooo-monero)
f47488c Fix GCC 9.1 build warnings (moneromooo-monero)
ce13a98 cmake: do not use -mmitigate-rop on GCC >= 9.1 (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r-- | src/device/device_ledger.cpp | 14 | ||||
-rw-r--r-- | src/device/device_ledger.hpp | 1 | ||||
-rw-r--r-- | src/p2p/net_peerlist_boost_serialization.h | 10 |
3 files changed, 21 insertions, 4 deletions
diff --git a/src/device/device_ledger.cpp b/src/device/device_ledger.cpp index 200370564..eba633da8 100644 --- a/src/device/device_ledger.cpp +++ b/src/device/device_ledger.cpp @@ -90,6 +90,20 @@ namespace hw { AKout = keys.AKout; } + ABPkeys &ABPkeys::operator=(const ABPkeys& keys) { + if (&keys == this) + return *this; + Aout = keys.Aout; + Bout = keys.Bout; + is_subaddress = keys.is_subaddress; + is_change_address = keys.is_change_address; + additional_key = keys.additional_key; + index = keys.index; + Pout = keys.Pout; + AKout = keys.AKout; + return *this; + } + bool Keymap::find(const rct::key& P, ABPkeys& keys) const { size_t sz = ABP.size(); for (size_t i=0; i<sz; i++) { diff --git a/src/device/device_ledger.hpp b/src/device/device_ledger.hpp index d4d98ce4a..fe9028733 100644 --- a/src/device/device_ledger.hpp +++ b/src/device/device_ledger.hpp @@ -77,6 +77,7 @@ namespace hw { ABPkeys(const rct::key& A, const rct::key& B, const bool is_subaddr, bool is_subaddress, bool is_change_address, size_t index, const rct::key& P,const rct::key& AK); ABPkeys(const ABPkeys& keys) ; ABPkeys() {index=0;is_subaddress=false;is_subaddress=false;is_change_address=false;} + ABPkeys &operator=(const ABPkeys &keys); }; class Keymap { diff --git a/src/p2p/net_peerlist_boost_serialization.h b/src/p2p/net_peerlist_boost_serialization.h index 40ef2ebcd..32f30adca 100644 --- a/src/p2p/net_peerlist_boost_serialization.h +++ b/src/p2p/net_peerlist_boost_serialization.h @@ -134,10 +134,11 @@ namespace boost a & port; a & length; - if (length > net::tor_address::buffer_size()) + const size_t buffer_size = net::tor_address::buffer_size(); + if (length > buffer_size) MONERO_THROW(net::error::invalid_tor_address, "Tor address too long"); - char host[net::tor_address::buffer_size()] = {0}; + char host[buffer_size] = {0}; a.load_binary(host, length); host[sizeof(host) - 1] = 0; @@ -155,10 +156,11 @@ namespace boost a & port; a & length; - if (length > net::i2p_address::buffer_size()) + const size_t buffer_size = net::i2p_address::buffer_size(); + if (length > buffer_size) MONERO_THROW(net::error::invalid_i2p_address, "i2p address too long"); - char host[net::i2p_address::buffer_size()] = {0}; + char host[buffer_size] = {0}; a.load_binary(host, length); host[sizeof(host) - 1] = 0; |