projects
/
kconfig-hardened-check.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CI: Add the test for the code checking that the cmdline file is not empty
[kconfig-hardened-check.git]
/
kernel_hardening_checker
/
__init__.py
diff --git
a/kernel_hardening_checker/__init__.py
b/kernel_hardening_checker/__init__.py
index 67e02690bee12aa8b6934f5ec3c7ee91cab044c0..5893fab542ddd3e16e1b22a55f86e5e21e1ab258 100644
(file)
--- a/
kernel_hardening_checker/__init__.py
+++ b/
kernel_hardening_checker/__init__.py
@@
-174,6
+174,9
@@
def parse_cmdline_file(mode: StrOrNone, parsed_options: Dict[str, str], fname: s
with open(fname, 'r', encoding='utf-8') as f:
line = f.readline()
with open(fname, 'r', encoding='utf-8') as f:
line = f.readline()
+ if not line:
+ sys.exit(f'[!] ERROR: empty "{fname}"')
+
opts = line.split()
line = f.readline()
opts = line.split()
line = f.readline()