mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-27 10:28:17 +00:00
rule engine: prevent integer underflow and dead code
This commit is contained in:
parent
b4bfade4ec
commit
fe33957303
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;
|
break;
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
|
if (rule_pos == 0) return -1;
|
||||||
return rule_pos - 1;
|
return rule_pos - 1;
|
||||||
|
|
||||||
default:
|
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 rule_pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool kernel_rules_has_noop (const kernel_rule_t *kernel_rules_buf, const u32 kernel_rules_cnt)
|
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