mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-23 23:19:09 +00:00
Merge pull request #1105 from philsmd/master
rule engine: prevent integer underflow and dead code
This commit is contained in:
commit
aa8fa5ff6e
8
src/rp.c
8
src/rp.c
@ -663,6 +663,7 @@ int kernel_rule_to_cpu_rule (char *rule_buf, kernel_rule_t *rule)
|
||||
break;
|
||||
|
||||
case 0:
|
||||
if (rule_pos == 0) return -1;
|
||||
return rule_pos - 1;
|
||||
|
||||
default:
|
||||
@ -670,12 +671,7 @@ int kernel_rule_to_cpu_rule (char *rule_buf, kernel_rule_t *rule)
|
||||
}
|
||||
}
|
||||
|
||||
if (rule_cnt > 0)
|
||||
{
|
||||
return rule_pos;
|
||||
}
|
||||
|
||||
return -1;
|
||||
return rule_pos;
|
||||
}
|
||||
|
||||
bool kernel_rules_has_noop (const kernel_rule_t *kernel_rules_buf, const u32 kernel_rules_cnt)
|
||||
|
Loading…
Reference in New Issue
Block a user