aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/lmdb/db_lmdb.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-06-14 16:19:45 +0200
committerRiccardo Spagni <ric@spagni.net>2019-06-14 16:19:45 +0200
commit1d5e8f461de0a04891e5e18b0f50e9cf2cf534e1 (patch)
tree196a29f8b13f0a26167d5ec085669002d468323a /src/blockchain_db/lmdb/db_lmdb.cpp
parentMerge pull request #5632 (diff)
parentrpc: restrict the recent cutoff size in restricted RPC mode (diff)
downloadmonero-1d5e8f461de0a04891e5e18b0f50e9cf2cf534e1.tar.xz
Merge pull request #5639
2eef90d6 rpc: restrict the recent cutoff size in restricted RPC mode (moneromooo-monero) 0564da5f ensure no NULL is passed to memcpy (moneromooo-monero) bc09766b abstract_tcp_server2: improve DoS resistance (moneromooo-monero) 1387549e serialization: check stream good flag at the end (moneromooo-monero) a00cabd4 tree-hash: allocate variable memory on heap, not stack (moneromooo-monero) f2152192 cryptonote: throw on tx hash calculation error (moneromooo-monero) db2b9fba serialization: fail on read_varint error (moneromooo-monero) 68ad5481 cryptonote_protocol: fix another potential P2P DoS (moneromooo-monero) 1cc61018 cryptonote_protocol: expand basic DoS protection (moneromooo-monero) 8f66b705 cryptonote_protocol_handler: prevent potential DoS (anonimal) 39169ace epee: basic sanity check on allocation size from untrusted source (moneromooo-monero)
Diffstat (limited to 'src/blockchain_db/lmdb/db_lmdb.cpp')
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp
index a03a0989b..f05eb0f30 100644
--- a/src/blockchain_db/lmdb/db_lmdb.cpp
+++ b/src/blockchain_db/lmdb/db_lmdb.cpp
@@ -1077,11 +1077,11 @@ void BlockchainLMDB::add_tx_amount_output_indices(const uint64_t tx_id,
int result = 0;
- int num_outputs = amount_output_indices.size();
+ size_t num_outputs = amount_output_indices.size();
MDB_val_set(k_tx_id, tx_id);
MDB_val v;
- v.mv_data = (void *)amount_output_indices.data();
+ v.mv_data = num_outputs ? (void *)amount_output_indices.data() : (void*)"";
v.mv_size = sizeof(uint64_t) * num_outputs;
// LOG_PRINT_L1("tx_outputs[tx_hash] size: " << v.mv_size);