Skip to content

Commit

Permalink
minor readability adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Abyss-W4tcher committed Jan 3, 2025
1 parent 32a9d16 commit 4a34b98
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions volatility3/framework/symbols/linux/utilities/tainting.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _module_flags_taint_pre_4_10_rc1(
"""
taints_string = ""
for char, taint_flag in linux_constants.TAINT_FLAGS.items():
if is_module and is_module != taint_flag.module:
if is_module and not taint_flag.module:
continue

if taints & taint_flag.shift:
Expand Down Expand Up @@ -79,12 +79,12 @@ def _module_flags_taint_post_4_10_rc1(
The raw taints string.
"""
taints_string = ""
for i, taint_flag in enumerate(self._kernel_taint_flags_list):
if is_module and is_module != taint_flag.module:
for taint_bit, taint_flag in enumerate(self._kernel_taint_flags_list):
if is_module and not taint_flag.module:
continue
c_true = chr(taint_flag.c_true)
c_false = chr(taint_flag.c_false)
if taints & (1 << i):
if taints & (1 << taint_bit):
taints_string += c_true
elif c_false != " ":
taints_string += c_false
Expand All @@ -97,7 +97,6 @@ def get_taints_as_plain_string(self, taints: int, is_module: bool = False) -> st
Args:
taints: The taints value, represented by an integer
is_module: Indicates if the taints value is associated with a built-in/LKM module
s
Returns:
The raw taints string.
Expand Down

0 comments on commit 4a34b98

Please sign in to comment.