aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/base/scan_name.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/base/scan_name.cpp')
-rw-r--r--src/lib/base/scan_name.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/base/scan_name.cpp b/src/lib/base/scan_name.cpp
index 8a20caddb..954db7c45 100644
--- a/src/lib/base/scan_name.cpp
+++ b/src/lib/base/scan_name.cpp
@@ -13,8 +13,7 @@ namespace Botan {
namespace {
-std::string make_arg(
- const std::vector<std::pair<size_t, std::string> >& name, size_t start)
+std::string make_arg(const std::vector<std::pair<size_t, std::string>>& name, size_t start)
{
std::string output = name[start].second;
size_t level = name[start].first;
@@ -60,7 +59,10 @@ SCAN_Name::SCAN_Name(const char* algo_spec) : SCAN_Name(std::string(algo_spec))
SCAN_Name::SCAN_Name(std::string algo_spec) : m_orig_algo_spec(algo_spec), m_alg_name(), m_args(), m_mode_info()
{
- std::vector<std::pair<size_t, std::string> > name;
+ if(algo_spec.size() == 0)
+ throw Invalid_Argument("Expected algorithm name, got empty string");
+
+ std::vector<std::pair<size_t, std::string>> name;
size_t level = 0;
std::pair<size_t, std::string> accum = std::make_pair(level, "");