From 348ef289db72d233f7133d1c82263cd03f5b8e2e Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Wed, 10 Jan 2024 10:41:43 -0600 Subject: [PATCH] GH-2060 Add better error if separator not provided correctly --- plugins/signature_provider_plugin/signature_provider_plugin.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/signature_provider_plugin/signature_provider_plugin.cpp b/plugins/signature_provider_plugin/signature_provider_plugin.cpp index fba48def38..31d928ee55 100644 --- a/plugins/signature_provider_plugin/signature_provider_plugin.cpp +++ b/plugins/signature_provider_plugin/signature_provider_plugin.cpp @@ -43,8 +43,10 @@ class signature_provider_plugin_impl { auto delim = spec.find("="); EOS_ASSERT(delim != std::string::npos, chain::plugin_config_exception, "Missing \"=\" in the key spec pair"); // public_key can be base64 encoded with trailing `=` + // e.g. --signature-provider PUB_BLS_FmgkiuA===KEY:PVT_BLS_NZhJZHFu while( spec.size() > delim+1 && spec[delim+1] == '=' ) ++delim; + EOS_ASSERT(delim < spec.size() + 1, chain::plugin_config_exception, "Missing spec data in the key spec pair"); auto pub_key_str = spec.substr(0, delim); auto spec_str = spec.substr(delim + 1);