mirror of
https://github.com/hashcat/hashcat.git
synced 2025-07-25 16:08:39 +00:00
fix buffer overflow in build_plain()
This commit is contained in:
parent
f7898da386
commit
6940f11b15
14
src/hashes.c
14
src/hashes.c
@ -330,18 +330,22 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
|
|||||||
|
|
||||||
// plain
|
// plain
|
||||||
|
|
||||||
u32 plain_buf[64] = { 0 };
|
u8 plain_buf[256+1];
|
||||||
|
|
||||||
u8 *plain_ptr = (u8 *) plain_buf;
|
memset (plain_buf, 0, sizeof (plain_buf));
|
||||||
|
|
||||||
|
u8 *plain_ptr = plain_buf;
|
||||||
int plain_len = 0;
|
int plain_len = 0;
|
||||||
|
|
||||||
build_plain (hashcat_ctx, device_param, plain, plain_buf, &plain_len);
|
build_plain (hashcat_ctx, device_param, plain, (u32 *)plain_buf, &plain_len);
|
||||||
|
|
||||||
if (module_ctx->module_build_plain_postprocess != MODULE_DEFAULT)
|
if (module_ctx->module_build_plain_postprocess != MODULE_DEFAULT)
|
||||||
{
|
{
|
||||||
u32 temp_buf[64] = { 0 };
|
u8 temp_buf[256+1] = { 0 };
|
||||||
|
|
||||||
const int temp_len = module_ctx->module_build_plain_postprocess (hashcat_ctx->hashconfig, hashcat_ctx->hashes, tmps, plain_buf, sizeof (plain_buf), plain_len, temp_buf, sizeof (temp_buf));
|
memset (temp_buf, 0, sizeof (temp_buf));
|
||||||
|
|
||||||
|
const int temp_len = module_ctx->module_build_plain_postprocess (hashcat_ctx->hashconfig, hashcat_ctx->hashes, tmps, (u32 *)plain_buf, sizeof (plain_buf), plain_len, (u32 *)temp_buf, sizeof (temp_buf));
|
||||||
|
|
||||||
if (temp_len < (int) sizeof (plain_buf))
|
if (temp_len < (int) sizeof (plain_buf))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user