From ba678bf39a67ccf857727f034ab21ee4e380f0df Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sun, 19 Jun 2022 23:45:41 +0300 Subject: [PATCH] Check that a kconfig option value is sane --- kconfig_hardened_check/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index ac2d6f6..58d82f2 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -784,6 +784,8 @@ def parse_kconfig_file(parsed_options, fname): if opt_is_on.match(line): option, value = line.split('=', 1) + if value == 'is not set': + sys.exit('[!] ERROR: bad enabled kconfig option "{}"'.format(line)) elif opt_is_off.match(line): option, value = line[2:].split(' ', 1) if value != 'is not set': -- 2.31.1