From 330ad34f1757c8993c1862b71ad8c416c25793a8 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Fri, 20 Aug 2021 10:41:44 +0200 Subject: [PATCH] Fixed unintentional overwriting of the --quiet option in benchmark and speed-only mode --- docs/changes.txt | 1 + src/hashcat.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 979eb5c9b..97e2787dd 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -27,6 +27,7 @@ - Fixed segfault when a combination of the flags --user and --show is given and a hash was specified directly on the command line - Fixed syntax check of HAS_VPERM macro in several kernel includes causing invalid error message for AMD GPUs on Windows - Fixed uninitialized tmps variable in autotune for slow hashes by calling _init and _prepare kernel before calling _loop kernel +- Fixed unintentional overwriting of the --quiet option in benchmark and speed-only mode ## ## Performance diff --git a/src/hashcat.c b/src/hashcat.c index 1beaf9a16..13ccf2919 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -1624,6 +1624,8 @@ int hashcat_session_execute (hashcat_ctx_t *hashcat_ctx) if (user_options->benchmark == true) { + const bool quiet_sav = user_options->quiet; + user_options->quiet = true; if (user_options->hash_mode_chgd == true) @@ -1648,17 +1650,19 @@ int hashcat_session_execute (hashcat_ctx_t *hashcat_ctx) } } - user_options->quiet = false; + user_options->quiet = quiet_sav; } else { + const bool quiet_sav = user_options->quiet; + if (user_options->speed_only == true) user_options->quiet = true; rc_final = outer_loop (hashcat_ctx); if (rc_final == -1) myabort (hashcat_ctx); - if (user_options->speed_only == true) user_options->quiet = false; + if (user_options->speed_only == true) user_options->quiet = quiet_sav; } EVENT (EVENT_OUTERLOOP_FINISHED);