aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-06-12 22:26:06 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-06-12 22:27:07 +0000
commitb712ae0af2aa394052a014709a70b57c57758255 (patch)
tree1fca46fc00270259d7d88427ff5f140eb3b20ea7 /src
parentMerge pull request #5619 (diff)
downloadmonero-b712ae0af2aa394052a014709a70b57c57758255.tar.xz
rpc: work around a GCC 7.4.0 (at least) bug
In static member function ‘static boost::optional<cryptonote::rpc::output_distribution_data> cryptonote::rpc::RpcHandler::get_output_distribution(const std::function<bool(long unsigned int, long unsigned int, long unsigned int, long unsigned int&, std::vector<long unsigned int>&, long unsigned int&)>&, uint64_t, uint64_t, uint64_t, const std::function<crypto::hash(long unsigned int)>&, bool, uint64_t)’: cc1plus: warning: ‘void* __builtin_memset(void*, int, long unsigned int)’: specified size 18446744073709551536 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
Diffstat (limited to 'src')
-rw-r--r--src/rpc/rpc_handler.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rpc/rpc_handler.cpp b/src/rpc/rpc_handler.cpp
index af5cb98a3..d528ffef3 100644
--- a/src/rpc/rpc_handler.cpp
+++ b/src/rpc/rpc_handler.cpp
@@ -63,7 +63,9 @@ namespace rpc
d.cached_to -= 10;
d.cached_top_hash = hash10;
d.cached_m10_hash = crypto::null_hash;
- d.cached_distribution.resize(d.cached_distribution.size() - 10);
+ CHECK_AND_ASSERT_MES(d.cached_distribution.size() >= 10, boost::none, "Cached distribution size does not match cached bounds");
+ for (int p = 0; p < 10; ++p)
+ d.cached_distribution.pop_back();
can_extend = true;
}
}