imgtool: check for unrecognized options (#11671)

This commit is contained in:
Lubomir Rintel 2023-10-29 12:55:07 +01:00 committed by GitHub
parent c40d893239
commit 6ffb563084
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;