1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-01-11 16:21:12 +00:00

prevent integer overflows in rp.c

This commit is contained in:
philsmd 2022-03-13 13:46:50 +01:00 committed by GitHub
parent 8bc4a92089
commit 8e4e42a613
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -770,6 +770,13 @@ int kernel_rules_load (hashcat_ctx_t *hashcat_ctx, kernel_rule_t **out_buf, u32
{
rule_len = (u32) fgetl (&fp, rule_buf, HCBUFSIZ_LARGE);
if (rule_line >= 0xffffffff)
{
event_log_error (hashcat_ctx, "Unsupported number of lines in rule file %s", rp_file);
return -1;
}
rule_line++;
if (rule_len == 0) continue;
@ -807,6 +814,13 @@ int kernel_rules_load (hashcat_ctx_t *hashcat_ctx, kernel_rule_t **out_buf, u32
continue;
}
if (kernel_rules_cnt >= 0xffffffff)
{
event_log_error (hashcat_ctx, "Unsupported number of rules in file %s", rp_file);
return -1;
}
kernel_rules_cnt++;
}