1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 08:08:10 +00:00

Fixed division by zero because backend_ctx->hardware_power_all was not re-inserted after refactoring device_param->hardware_power

This commit is contained in:
Jens Steube 2021-09-08 17:37:18 +02:00
parent 120326c117
commit 721e1ea54d
2 changed files with 12 additions and 1 deletions

View File

@ -4,6 +4,7 @@
## Bugs
##
- Fixed division by zero because backend_ctx->hardware_power_all was not re-inserted after refactoring device_param->hardware_power
- Fixed invalid progress counter initialization in attack-mode 9 when using --skip or --restore
- Fixed out-of-boundary reads in attack-mode 9 that were caused by a missing work item limit in the refactored autotune engine

View File

@ -10725,6 +10725,8 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
u64 size_total_host_all = 0;
u32 hardware_power_all = 0;
for (int backend_devices_idx = 0; backend_devices_idx < backend_ctx->backend_devices_cnt; backend_devices_idx++)
{
/**
@ -15082,9 +15084,18 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx)
}
}
hardware_power_all += hardware_power_max;
EVENT_DATA (EVENT_BACKEND_DEVICE_INIT_POST, &backend_devices_idx, sizeof (int));
}
if (user_options->benchmark == false)
{
if (hardware_power_all == 0) return -1;
}
backend_ctx->hardware_power_all = hardware_power_all;
EVENT_DATA (EVENT_BACKEND_SESSION_HOSTMEM, &size_total_host_all, sizeof (u64));
return 0;
@ -15578,7 +15589,6 @@ void backend_session_reset (hashcat_ctx_t *hashcat_ctx)
device_param->hardware_power = 0;
}
backend_ctx->hardware_power_all = 0;
backend_ctx->kernel_power_all = 0;
backend_ctx->kernel_power_final = 0;
}