From e3c097c88bca1a9395fdf91738e3b2aab314c1bc Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 26 Oct 2024 14:51:11 +0200 Subject: [PATCH] do not allow --show and --restore --- src/hashcat.c | 2 ++ src/user_options.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/hashcat.c b/src/hashcat.c index a6dd823d1..642a13952 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -1430,6 +1430,8 @@ bool autodetect_hashmode_test (hashcat_ctx_t *hashcat_ctx) { char *input_buf = user_options_extra->hc_hash; + if (!input_buf) return false; + size_t input_len = strlen (input_buf); char *hash_buf = NULL; diff --git a/src/user_options.c b/src/user_options.c index b1ed588f4..3576cb3d2 100644 --- a/src/user_options.c +++ b/src/user_options.c @@ -1059,6 +1059,13 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx) return 0; } + if (user_options->show == true && user_options->restore == true) + { + event_log_error (hashcat_ctx, "Mixing --show and --restore is not allowed."); + + return -1; + } + if (user_options->show == true || user_options->left == true) { if (user_options->remove == true)