Skip to content

Commit

Permalink
Fixed a race condition when a session finishes the input-base was fre…
Browse files Browse the repository at this point in the history
…ed but accessed afterwards

Fixes #1192
  • Loading branch information
jsteube committed Mar 19, 2017
1 parent 9558fcc commit c7ed2ad
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion deps/OpenCL-Headers/CL
Submodule CL updated 5 files
+107 −340 cl.h
+1 −1 cl_dx9_media_sharing.h
+4 −229 cl_ext.h
+2 −145 cl_ext_intel.h
+9 −81 cl_platform.h
3 changes: 2 additions & 1 deletion docs/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
- Fixed a problem where --stdout combined with custom charsets incorrectly displayed an error message
- Fixed a typo that resulted in the minimum password length not being correctly initialized
- Fixed a problem with parsing and displaying -m 7000 = Fortigate (FortiOS) hashes
- Fixed --remove was not applied in case all hashes have been cracked by help of potfile or weak-hash check
- Fixed --remove was not applied in case all hashes have been cracked by potfile or weak-hash check
- Fixed a race condition when a session finishes the input-base was freed but accessed afterwards

##
## Technical
Expand Down
22 changes: 11 additions & 11 deletions src/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ char *status_get_session (const hashcat_ctx_t *hashcat_ctx)
{
const user_options_t *user_options = hashcat_ctx->user_options;

return user_options->session;
return strdup (user_options->session);
}

char *status_get_status_string (const hashcat_ctx_t *hashcat_ctx)
Expand Down Expand Up @@ -436,38 +436,38 @@ char *status_get_input_base (const hashcat_ctx_t *hashcat_ctx)
{
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;

return straight_ctx->dict;
return strdup (straight_ctx->dict);
}
else if (user_options->attack_mode == ATTACK_MODE_COMBI)
{
const combinator_ctx_t *combinator_ctx = hashcat_ctx->combinator_ctx;

if (combinator_ctx->combs_mode == COMBINATOR_MODE_BASE_LEFT)
{
return combinator_ctx->dict1;
return strdup (combinator_ctx->dict1);
}
else
{
return combinator_ctx->dict2;
return strdup (combinator_ctx->dict2);
}
}
else if (user_options->attack_mode == ATTACK_MODE_BF)
{
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;

return mask_ctx->mask;
return strdup (mask_ctx->mask);
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
{
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;

return straight_ctx->dict;
return strdup (straight_ctx->dict);
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx;

return straight_ctx->dict;
return strdup (straight_ctx->dict);
}

return NULL;
Expand Down Expand Up @@ -569,11 +569,11 @@ char *status_get_input_mod (const hashcat_ctx_t *hashcat_ctx)

if (combinator_ctx->combs_mode == COMBINATOR_MODE_BASE_LEFT)
{
return combinator_ctx->dict2;
return strdup (combinator_ctx->dict2);
}
else
{
return combinator_ctx->dict1;
return strdup (combinator_ctx->dict1);
}
}
else if (user_options->attack_mode == ATTACK_MODE_BF)
Expand All @@ -584,13 +584,13 @@ char *status_get_input_mod (const hashcat_ctx_t *hashcat_ctx)
{
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;

return mask_ctx->mask;
return strdup (mask_ctx->mask);
}
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
{
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;

return mask_ctx->mask;
return strdup (mask_ctx->mask);
}

return NULL;
Expand Down

0 comments on commit c7ed2ad

Please sign in to comment.