From d0b694203778b518ef3c98267aae5b4eaa9d6dfa Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Mon, 14 Feb 2022 19:50:21 +0300 Subject: [PATCH] Add more ComplexOptCheck validation --- 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 12edc9f..d69dded 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -175,6 +175,8 @@ class ComplexOptCheck: self.opts = opts if not self.opts: sys.exit('[!] ERROR: empty {} check'.format(self.__class__.__name__)) + if len(self.opts) == 1: + sys.exit('[!] ERROR: useless {} check'.format(self.__class__.__name__)) if not isinstance(opts[0], KconfigCheck): sys.exit('[!] ERROR: invalid {} check: {}'.format(self.__class__.__name__, opts)) self.result = None -- 2.31.1