From fe18f5140620e8b3dd22de5f85b638eacc28b3a0 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Wed, 22 Jun 2016 11:32:40 +0200 Subject: [PATCH] Fix invalid error CL_INVALID_VALUE caused by a zero length copy when using large hashlists --- src/hashcat.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/hashcat.c b/src/hashcat.c index 6656862..9b4daac 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -15337,6 +15337,10 @@ int main (int argc, char **argv) // now check if all device-memory sizes which depend on the kernel_accel_max amplifier are within its boundaries // if not, decrease amplifier and try again + if (size_pws > device_param->device_maxmem_alloc) skip = 1; + if (size_tmps > device_param->device_maxmem_alloc) skip = 1; + if (size_hooks > device_param->device_maxmem_alloc) skip = 1; + int skip = 0; const u64 size_total @@ -15367,10 +15371,7 @@ int main (int argc, char **argv) + size_tm + size_tmps; - // Don't ask me, ask AMD! - - if (size_total > device_param->device_maxmem_alloc) skip = 1; - if (size_total > device_param->device_global_mem) skip = 1; + if (size_total > device_param->device_global_mem) skip = 1; if (skip == 1) { @@ -15382,14 +15383,12 @@ int main (int argc, char **argv) break; } - /* - if (kernel_accel_max == 0) + if (kernel_accel_max < kernel_accel_min) { - log_error ("- Device #%u: Device does not provide enough allocatable device-memory to handle hash-type %u", device_id + 1, data.hash_mode); + log_error ("- Device #%u: Device does not provide enough allocatable device-memory to handle this attack", device_id + 1); return -1; } - */ device_param->kernel_accel_min = kernel_accel_min; device_param->kernel_accel_max = kernel_accel_max; -- 2.25.1