Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kernel-hardening-checker
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
kernel-hardening-checker
Commits
d8aa1269
Commit
d8aa1269
authored
Mar 24, 2023
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent populating the checklist with empty data
parent
f8fb03be
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
engine.py
kconfig_hardened_check/engine.py
+2
-0
test_engine.py
kconfig_hardened_check/test_engine.py
+3
-0
No files found.
kconfig_hardened_check/engine.py
View file @
d8aa1269
...
@@ -254,6 +254,8 @@ def populate_simple_opt_with_data(opt, data, data_type):
...
@@ -254,6 +254,8 @@ def populate_simple_opt_with_data(opt, data, data_type):
f
'invalid opt type "{opt.type}"'
f
'invalid opt type "{opt.type}"'
assert
(
data_type
in
SIMPLE_OPTION_TYPES
),
\
assert
(
data_type
in
SIMPLE_OPTION_TYPES
),
\
f
'invalid data type "{data_type}"'
f
'invalid data type "{data_type}"'
assert
(
data
),
\
f
'empty data'
if
data_type
!=
opt
.
type
:
if
data_type
!=
opt
.
type
:
return
return
...
...
kconfig_hardened_check/test_engine.py
View file @
d8aa1269
...
@@ -53,8 +53,11 @@ class TestEngine(unittest.TestCase):
...
@@ -53,8 +53,11 @@ class TestEngine(unittest.TestCase):
parsed_kconfig_options
,
parsed_cmdline_options
,
kernel_version
,
parsed_kconfig_options
,
parsed_cmdline_options
,
kernel_version
,
result
):
result
):
# populate the checklist with data
# populate the checklist with data
if
parsed_kconfig_options
:
populate_with_data
(
checklist
,
parsed_kconfig_options
,
'kconfig'
)
populate_with_data
(
checklist
,
parsed_kconfig_options
,
'kconfig'
)
if
parsed_cmdline_options
:
populate_with_data
(
checklist
,
parsed_cmdline_options
,
'cmdline'
)
populate_with_data
(
checklist
,
parsed_cmdline_options
,
'cmdline'
)
if
kernel_version
:
populate_with_data
(
checklist
,
kernel_version
,
'version'
)
populate_with_data
(
checklist
,
kernel_version
,
'version'
)
# now everything is ready, perform the checks
# now everything is ready, perform the checks
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment