diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-11 22:36:58 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-18 15:15:40 +0000 |
commit | 45a1c4c0885584554668c89bd6976474af01e2f5 (patch) | |
tree | 1e43812b37e0f2c2cb967f52133e0ddb09fbb61e /src/mnemonics/electrum-words.cpp | |
parent | tests: fix a buffer overread in a unit test (diff) | |
download | monero-45a1c4c0885584554668c89bd6976474af01e2f5.tar.xz |
add empty container sanity checks when using front() and back()
Diffstat (limited to 'src/mnemonics/electrum-words.cpp')
-rw-r--r-- | src/mnemonics/electrum-words.cpp | 2 |
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(); |