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:
parent
8bc4a92089
commit
8e4e42a613
14
src/rp.c
14
src/rp.c
@ -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++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user