From bdb29dfb8acd66c803769238ca4b204839f5da46 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 10 Apr 2013 16:51:23 +0000 Subject: Avoid crash in get_aead if handed a string with no slashes --- src/aead/aead.cpp | 3 +++ 1 file changed, 3 insertions(+) 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]; -- cgit v1.2.3