mirror of
https://github.com/hashcat/hashcat.git
synced 2025-01-11 16:21:12 +00:00
Fix OSX segfault on check_hash()
This commit is contained in:
parent
5accadb511
commit
dbe60b845b
@ -231,7 +231,9 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
|
||||
|
||||
// hash
|
||||
|
||||
char out_buf[HCBUFSIZ_LARGE];
|
||||
char *out_buf = (char *) hcmalloc (hashcat_ctx, HCBUFSIZ_LARGE);
|
||||
|
||||
if (!out_buf) return;
|
||||
|
||||
out_buf[0] = 0;
|
||||
|
||||
@ -276,6 +278,8 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
|
||||
|
||||
const int tmp_len = outfile_write (hashcat_ctx, out_buf, plain_ptr, plain_len, crackpos, NULL, 0, tmp_buf);
|
||||
|
||||
free (out_buf);
|
||||
|
||||
outfile_write_close (hashcat_ctx);
|
||||
|
||||
EVENT_DATA (EVENT_CRACKER_HASH_CRACKED, tmp_buf, tmp_len);
|
||||
|
@ -256,7 +256,9 @@ void potfile_write_append (hashcat_ctx_t *hashcat_ctx, const char *out_buf, u8 *
|
||||
|
||||
if (potfile_ctx->enabled == false) return;
|
||||
|
||||
char tmp_buf[HCBUFSIZ_LARGE];
|
||||
char *tmp_buf = (char *) hcmalloc (hashcat_ctx, HCBUFSIZ_LARGE);
|
||||
|
||||
if (!tmp_buf) return;
|
||||
|
||||
int tmp_len = 0;
|
||||
|
||||
@ -300,6 +302,8 @@ void potfile_write_append (hashcat_ctx_t *hashcat_ctx, const char *out_buf, u8 *
|
||||
tmp_buf[tmp_len] = 0;
|
||||
|
||||
fprintf (potfile_ctx->fp, "%s" EOL, tmp_buf);
|
||||
|
||||
free (tmp_buf);
|
||||
}
|
||||
|
||||
int potfile_remove_parse (hashcat_ctx_t *hashcat_ctx)
|
||||
|
Loading…
Reference in New Issue
Block a user