mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-30 03:48:17 +00:00
Fix buffer overflow in status_get_hash_target()
This commit is contained in:
parent
a460ab01b6
commit
0a26b09684
@ -226,7 +226,9 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
|
||||
|
||||
// hash
|
||||
|
||||
char out_buf[HCBUFSIZ_LARGE] = { 0 };
|
||||
char out_buf[HCBUFSIZ_LARGE];
|
||||
|
||||
out_buf[0] = 0;
|
||||
|
||||
ascii_digest (hashcat_ctx, out_buf, salt_pos, digest_pos);
|
||||
|
||||
|
10
src/status.c
10
src/status.c
@ -269,11 +269,17 @@ char *status_get_hash_target (const hashcat_ctx_t *hashcat_ctx)
|
||||
}
|
||||
else
|
||||
{
|
||||
char *tmp_buf = (char *) malloc (HCBUFSIZ_TINY);
|
||||
char *tmp_buf = (char *) malloc (HCBUFSIZ_LARGE);
|
||||
|
||||
tmp_buf[0] = 0;
|
||||
|
||||
ascii_digest ((hashcat_ctx_t *) hashcat_ctx, tmp_buf, 0, 0);
|
||||
|
||||
return tmp_buf;
|
||||
char *tmp_buf2 = strdup (tmp_buf);
|
||||
|
||||
free (tmp_buf);
|
||||
|
||||
return tmp_buf2;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user