summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/imgtool/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/imgtool/main.cpp')
-rw-r--r--src/tools/imgtool/main.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tools/imgtool/main.cpp b/src/tools/imgtool/main.cpp
index 8dd6affbc43..9777a8b35f8 100644
--- a/src/tools/imgtool/main.cpp
+++ b/src/tools/imgtool/main.cpp
@@ -115,6 +115,9 @@ static int parse_options(int argc, char *argv[], int minunnamed, int maxunnamed,
goto error; /* Too few unnamed */
util::option_resolution::entry *entry = resolution->find(name);
+ if (entry == nullptr)
+ goto error; /* Unknown option */
+
if (entry->option_type() == util::option_guide::entry::option_type::ENUM_BEGIN)
{
const util::option_guide::entry *enum_value;