From 7669cc1a41713dea016fa3520e485c1525096cc8 Mon Sep 17 00:00:00 2001 From: Arthur Chan Date: Thu, 13 Jun 2024 10:48:57 +0000 Subject: [PATCH] Fix bug Signed-off-by: Arthur Chan --- tools/web-fuzzing-introspection/app/webapp/models.py | 4 +++- tools/web-fuzzing-introspection/app/webapp/routes.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/web-fuzzing-introspection/app/webapp/models.py b/tools/web-fuzzing-introspection/app/webapp/models.py index f6664e1a3..bc813ddb1 100644 --- a/tools/web-fuzzing-introspection/app/webapp/models.py +++ b/tools/web-fuzzing-introspection/app/webapp/models.py @@ -127,7 +127,9 @@ def __init__(self, self.is_accessible = is_accessible self.is_jvm_library = is_jvm_library self.is_enum_class = is_enum_class - self.__dict__ = { + + def to_dict(): + return { 'function_name': self.name, 'function_arguments': self.function_arguments, 'project': self.project, diff --git a/tools/web-fuzzing-introspection/app/webapp/routes.py b/tools/web-fuzzing-introspection/app/webapp/routes.py index 347b719ca..18be159ae 100644 --- a/tools/web-fuzzing-introspection/app/webapp/routes.py +++ b/tools/web-fuzzing-introspection/app/webapp/routes.py @@ -574,6 +574,7 @@ def oracle_1(all_functions, all_projects, max_project_count=5): and function.accummulated_cyclomatic_complexity > 30): to_continue = False + for proj in all_projects: if proj.name == function.project and proj.language in { 'c', 'c++' @@ -1467,7 +1468,7 @@ def api_all_interesting_function_targets(): # Rewrite list list_of_targets = [] for func, heuristic_name in functions_to_display: - dict_to_use = func.__dict__() + dict_to_use = func.to_dict() list_of_targets.append({ 'function_target': dict_to_use,