Skip to content

Commit 35129c1

Browse files
authored
Merge pull request #67 from Wenzel/fix_set_intersection
Fix set intersection
2 parents 876c3d7 + b1db671 commit 35129c1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

checksec/elf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,14 @@ def __get_libc(self) -> Libc:
167167
def fortified(self) -> FrozenSet[str]:
168168
"""Get the list of fortified symbols"""
169169
libc = self.__get_libc
170-
return self.set_dyn_syms ^ libc.fortified_symbols
170+
return self.set_dyn_syms & libc.fortified_symbols
171171

172172
@property
173173
@lru_cache()
174174
def fortifiable(self) -> FrozenSet[str]:
175175
"""Get the list of fortifiable symbols (fortified + unfortified)"""
176176
libc = self.__get_libc
177-
return self.set_dyn_syms ^ (self.fortified | libc.fortified_symbols_base)
177+
return self.set_dyn_syms & (self.fortified | libc.fortified_symbols_base)
178178

179179
@property
180180
def checksec_state(self) -> ELFChecksecData:
@@ -188,7 +188,7 @@ def checksec_state(self) -> ELFChecksecData:
188188
# all fortified !
189189
score = 100
190190
else:
191-
score = (fortified_count * 100) / (fortified_count + fortifiable_count)
191+
score = (fortified_count * 100) / fortifiable_count
192192
score = round(score)
193193

194194
fortify_source = True if fortified_count != 0 else False

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setuptools.setup(
1010
name="checksec.py",
11-
version="0.4.0",
11+
version="0.4.1",
1212
author="Mathieu Tarral",
1313
author_email="[email protected]",
1414
description="Checksec tool implemented in Python",

0 commit comments

Comments
 (0)