1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-04 22:49:15 +00:00

Fixed out-of-boundary read in autotune.c when a fast hash defines a kernel_loops_min value that is higher than the actual number of amplifiers provided by the user

This commit is contained in:
jsteube 2023-07-04 09:40:39 +00:00
parent bfa7183370
commit ab932815ea

View File

@ -9797,8 +9797,10 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
device_param->size_results = size_results;
u64 size_rules = (u64) straight_ctx->kernel_rules_cnt * sizeof (kernel_rule_t);
u64 size_rules_c = (u64) KERNEL_RULES * sizeof (kernel_rule_t);
u32 aligned_rules_cnt = MAX (MAX (straight_ctx->kernel_rules_cnt, device_param->kernel_loops_min), KERNEL_RULES);
u64 size_rules = (u64) aligned_rules_cnt * sizeof (kernel_rule_t);
u64 size_rules_c = (u64) KERNEL_RULES * sizeof (kernel_rule_t);
device_param->size_rules = size_rules;
device_param->size_rules_c = size_rules_c;