aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2013-04-10 16:51:23 +0000
committerlloyd <[email protected]>2013-04-10 16:51:23 +0000
commitbdb29dfb8acd66c803769238ca4b204839f5da46 (patch)
tree52ef47ab09b84a6cfb578f8231a8e87184d85096
parent57ffb9560793ba9f3feeb2345ba196e86119ca9f (diff)
Avoid crash in get_aead if handed a string with no slashes
-rw-r--r--src/aead/aead.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/aead/aead.cpp b/src/aead/aead.cpp
index 62d6d5f44..1ec7b4a4a 100644
--- a/src/aead/aead.cpp
+++ b/src/aead/aead.cpp
@@ -30,6 +30,9 @@ AEAD_Mode* get_aead(const std::string& algo_spec, Cipher_Dir direction)
if(algo_parts.empty())
throw Invalid_Algorithm_Name(algo_spec);
+ if(algo_parts.size() < 2)
+ return nullptr;
+
const std::string cipher_name = algo_parts[0];
const std::string mode_name = algo_parts[1];