1
0
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:
Jens Steube 2017-02-15 12:44:12 +01:00 committed by GitHub
commit aa8fa5ff6e

View File

@ -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)