1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-23 07:08:19 +00:00

rp: prevent crash in case of too little RAM for rules

This commit is contained in:
philsmd 2022-09-14 16:19:51 +02:00 committed by GitHub
parent feea399625
commit 1cdf4682b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -893,6 +893,18 @@ int kernel_rules_load (hashcat_ctx_t *hashcat_ctx, kernel_rule_t **out_buf, u32
kernel_rule_t *kernel_rules_buf = (kernel_rule_t *) hccalloc (kernel_rules_cnt, sizeof (kernel_rule_t));
if (kernel_rules_buf == NULL)
{
event_log_error (hashcat_ctx, "Not enough allocatable memory (RAM) for this ruleset.");
hcfree (all_kernel_rules_cnt);
hcfree (all_kernel_rules_buf);
hcfree (repeats);
return -1;
}
for (u32 i = 0; i < kernel_rules_cnt; i++)
{
u32 out_pos = 0;