mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-29 11:28:15 +00:00
Merge pull request #3223 from philsmd/philsmd-rules-limit
prevent integer overflows in rp.c
This commit is contained in:
commit
cc794ed843
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);
|
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++;
|
rule_line++;
|
||||||
|
|
||||||
if (rule_len == 0) continue;
|
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;
|
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++;
|
kernel_rules_cnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user