From 826de76bd6434c714aad796dd276774c22913cd7 Mon Sep 17 00:00:00 2001 From: jsteube Date: Thu, 23 Mar 2017 16:41:12 +0100 Subject: [PATCH] Fix invalid strdup of NULL in stdin mode --- src/status.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/status.c b/src/status.c index 468f01973..3f1f497a5 100644 --- a/src/status.c +++ b/src/status.c @@ -430,13 +430,17 @@ int status_get_input_mode (const hashcat_ctx_t *hashcat_ctx) char *status_get_input_base (const hashcat_ctx_t *hashcat_ctx) { - const user_options_t *user_options = hashcat_ctx->user_options; + const user_options_t *user_options = hashcat_ctx->user_options; + const user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra; if (user_options->attack_mode == ATTACK_MODE_STRAIGHT) { - const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx; + if (user_options_extra->wordlist_mode == WL_MODE_FILE) + { + const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx; - return strdup (straight_ctx->dict); + return strdup (straight_ctx->dict); + } } else if (user_options->attack_mode == ATTACK_MODE_COMBI) {