diff --git a/mobsf/StaticAnalyzer/views/common/binary/macho.py b/mobsf/StaticAnalyzer/views/common/binary/macho.py index b96b3b6b02..a1a6ef85fb 100644 --- a/mobsf/StaticAnalyzer/views/common/binary/macho.py +++ b/mobsf/StaticAnalyzer/views/common/binary/macho.py @@ -213,9 +213,12 @@ def has_pie(self): def has_canary(self): stk_check = '___stack_chk_fail' stk_guard = '___stack_chk_guard' - has_stk_check = any(str(func).strip() == stk_check for func in self.macho.imported_functions) - has_stk_guard = any(str(func).strip() == stk_guard for func in self.macho.imported_functions) - + imp_func_gen = self.macho.imported_functions + has_stk_check = any( + str(func).strip() == stk_check for func in imp_func_gen) + has_stk_guard = any( + str(func).strip() == stk_guard for func in imp_func_gen) + return has_stk_check and has_stk_guard def has_arc(self):