1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-01-22 21:51:07 +00:00

Fixed out-of-boundary write in slow candidates mode in combinator attack update

This commit is contained in:
Jens Steube 2021-06-24 13:13:02 +02:00
parent 1a4758da83
commit 84cf5e70e7

View File

@ -315,14 +315,18 @@ void slow_candidates_next (hashcat_ctx_t *hashcat_ctx, void *extra_info)
// this can overflow so we move it up
extra_info_combi->out_len += line_len;
if (extra_info_combi->out_len <= sizeof (extra_info_combi->out_buf))
if ((extra_info_combi->out_len + line_len) <= sizeof (extra_info_combi->out_buf))
{
memcpy (extra_info_combi->out_buf + extra_info_combi->out_len, line_buf, line_len);
extra_info_combi->out_len += line_len;
memset (extra_info_combi->out_buf + extra_info_combi->out_len, 0, sizeof (extra_info_combi->out_buf) - extra_info_combi->out_len);
}
else
{
extra_info_combi->out_len += line_len;
}
extra_info_combi->comb_pos_prev = extra_info_combi->comb_pos;