From bade4b33c004071ffd5f7b024f1fe93c81e8bfb7 Mon Sep 17 00:00:00 2001 From: stasinopoulos Date: Thu, 19 Dec 2024 17:48:34 +0200 Subject: [PATCH] Potential fix https://github.com/commixproject/commix/issues/988 --- src/utils/crawler.py | 44 ++++++++++++++++++++++--------------------- src/utils/settings.py | 2 +- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/utils/crawler.py b/src/utils/crawler.py index 01ffeb9465..902c5a1ad1 100644 --- a/src/utils/crawler.py +++ b/src/utils/crawler.py @@ -102,27 +102,29 @@ def normalize_results(output_href): Store crawling results to a temporary file. """ def store_crawling(output_href): - while True: - message = "Do you want to store crawling results to a temporary file " - message += "(for eventual further processing with other tools)? [y/N] > " - message = common.read_input(message, default="N", check_batch=True) - if message in settings.CHOICE_YES: - filename = tempfile.mkstemp(suffix=settings.OUTPUT_FILE_EXT)[1] - info_msg = "Writing crawling results to a temporary file '" + str(filename) + "'." - settings.print_data_to_stdout(settings.print_info_msg(info_msg)) - with open(filename, "a") as crawling_results: - for url in output_href: - crawling_results.write(url.encode(settings.DEFAULT_CODEC).decode() + "\n") - return - elif message in settings.CHOICE_NO: - return - elif message in settings.CHOICE_QUIT: - raise SystemExit() - else: - common.invalid_option(message) - pass - - + try: + while True: + message = "Do you want to store crawling results to a temporary file " + message += "(for eventual further processing with other tools)? [y/N] > " + message = common.read_input(message, default="N", check_batch=True) + if message in settings.CHOICE_YES: + filename = tempfile.mkstemp(suffix=settings.OUTPUT_FILE_EXT)[1] + info_msg = "Writing crawling results to a temporary file '" + str(filename) + "'." + settings.print_data_to_stdout(settings.print_info_msg(info_msg)) + with open(filename, "a") as crawling_results: + for url in output_href: + crawling_results.write(url.encode(settings.DEFAULT_CODEC).decode() + "\n") + return + elif message in settings.CHOICE_NO: + return + elif message in settings.CHOICE_QUIT: + raise SystemExit() + else: + common.invalid_option(message) + pass + except: + pass + """ Check for URLs in sitemap.xml. """ diff --git a/src/utils/settings.py b/src/utils/settings.py index e78caaafb4..47029b6d19 100755 --- a/src/utils/settings.py +++ b/src/utils/settings.py @@ -262,7 +262,7 @@ def sys_argv_errors(): DESCRIPTION = "The command injection exploiter" AUTHOR = "Anastasios Stasinopoulos" VERSION_NUM = "4.0" -REVISION = "120" +REVISION = "121" STABLE_RELEASE = False VERSION = "v" if STABLE_RELEASE: