aboutsummaryrefslogtreecommitdiff
path: root/src/mnemonics
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-12-11 22:36:58 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-12-18 15:15:40 +0000
commit45a1c4c0885584554668c89bd6976474af01e2f5 (patch)
tree1e43812b37e0f2c2cb967f52133e0ddb09fbb61e /src/mnemonics
parenttests: fix a buffer overread in a unit test (diff)
downloadmonero-45a1c4c0885584554668c89bd6976474af01e2f5.tar.xz
add empty container sanity checks when using front() and back()
Diffstat (limited to 'src/mnemonics')
-rw-r--r--src/mnemonics/electrum-words.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mnemonics/electrum-words.cpp b/src/mnemonics/electrum-words.cpp
index 1b14905f6..ba67952aa 100644
--- a/src/mnemonics/electrum-words.cpp
+++ b/src/mnemonics/electrum-words.cpp
@@ -205,6 +205,8 @@ namespace
*/
bool checksum_test(std::vector<std::string> seed, uint32_t unique_prefix_length)
{
+ if (seed.empty())
+ return false;
// The last word is the checksum.
std::string last_word = seed.back();
seed.pop_back();