1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-23 00:28:11 +00:00

Change memcpy to memmove since it overlaps

This commit is contained in:
Rosen Penev 2017-11-04 23:22:59 -07:00
parent 51a5e1cc51
commit 4165f94e51

View File

@ -253,11 +253,11 @@ static int mangle_insert_multi (char arr[RP_PASSWORD_SIZE], int arr_len, int arr
if (arr2_cpy < 1) return (RULE_RC_SYNTAX_ERROR);
memcpy (arr2, arr2 + arr2_pos, arr2_len - arr2_pos);
memmove (arr2, arr2 + arr2_pos, arr2_len - arr2_pos);
memcpy (arr2 + arr2_cpy, arr + arr_pos, arr_len - arr_pos);
memcpy (arr2 + arr2_cpy, arr + arr_pos, arr_len - arr_pos);
memcpy (arr + arr_pos, arr2, arr_len - arr_pos + arr2_cpy);
memcpy (arr + arr_pos, arr2, arr_len - arr_pos + arr2_cpy);
return (arr_len + arr2_cpy);
}
@ -844,14 +844,10 @@ int _old_apply_rule (char *rule, int rule_len, char in[RP_PASSWORD_SIZE], int in
int run_rule_engine (const int rule_len, const char *rule_buf)
{
if (rule_len == 0)
{
return 0;
}
else if (rule_len == 1)
{
if (rule_len == 0) return 0;
if (rule_len == 1)
if (rule_buf[0] == RULE_OP_MANGLE_NOOP) return 0;
}
return 1;
}