aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic/cryptonote_basic.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-12-12 11:08:11 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-12-18 15:15:49 +0000
commitb49ddc766de47b40aa705a0a0c0bb901c743908d (patch)
treeedac56cb5d089c91a98164126b295b4cd6334b4d /src/cryptonote_basic/cryptonote_basic.h
parentcheck return value for generate_key_derivation and derive_public_key (diff)
downloadmonero-b49ddc766de47b40aa705a0a0c0bb901c743908d.tar.xz
check accessing an element past the end of a container
Diffstat (limited to '')
-rw-r--r--src/cryptonote_basic/cryptonote_basic.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cryptonote_basic/cryptonote_basic.h b/src/cryptonote_basic/cryptonote_basic.h
index 89dda8c3d..821c21d84 100644
--- a/src/cryptonote_basic/cryptonote_basic.h
+++ b/src/cryptonote_basic/cryptonote_basic.h
@@ -259,7 +259,7 @@ namespace cryptonote
ar.tag("rctsig_prunable");
ar.begin_object();
r = rct_signatures.p.serialize_rctsig_prunable(ar, rct_signatures.type, vin.size(), vout.size(),
- vin[0].type() == typeid(txin_to_key) ? boost::get<txin_to_key>(vin[0]).key_offsets.size() - 1 : 0);
+ vin.size() > 0 && vin[0].type() == typeid(txin_to_key) ? boost::get<txin_to_key>(vin[0]).key_offsets.size() - 1 : 0);
if (!r || !ar.stream().good()) return false;
ar.end_object();
}