From 5b88ee0830a5e602bf680e2efe7d8edf658629f4 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Tue, 12 Mar 2019 16:42:23 +0300 Subject: [PATCH] Add a sanity check and do minor refactoring --- kconfig-hardened-check.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kconfig-hardened-check.py b/kconfig-hardened-check.py index 6714f05..879ff7b 100755 --- a/kconfig-hardened-check.py +++ b/kconfig-hardened-check.py @@ -101,9 +101,12 @@ class OR(ComplexOptCheck): # OR(, ) def check(self): + if not self.opts: + sys.exit('[!] ERROR: invalid OR check') + for i, opt in enumerate(self.opts): - result, msg = opt.check() - if result: + ret, msg = opt.check() + if ret: if i == 0: self.result = opt.result else: -- 2.31.1