1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-01-12 00:31:41 +00:00

Fix invalid strdup of NULL in stdin mode

This commit is contained in:
jsteube 2017-03-23 16:41:12 +01:00
parent 9ab1fefd19
commit 826de76bd6

View File

@ -431,13 +431,17 @@ int status_get_input_mode (const hashcat_ctx_t *hashcat_ctx)
char *status_get_input_base (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) if (user_options->attack_mode == ATTACK_MODE_STRAIGHT)
{
if (user_options_extra->wordlist_mode == WL_MODE_FILE)
{ {
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx; 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) else if (user_options->attack_mode == ATTACK_MODE_COMBI)
{ {
const combinator_ctx_t *combinator_ctx = hashcat_ctx->combinator_ctx; const combinator_ctx_t *combinator_ctx = hashcat_ctx->combinator_ctx;