From 5ea1bd2a9919c0dc306fa5829caadb7e89e2384a Mon Sep 17 00:00:00 2001 From: philsmd Date: Tue, 14 Feb 2017 19:22:51 +0100 Subject: [PATCH] minor: the step value should never be zero --- src/hwmon.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/hwmon.c b/src/hwmon.c index ee486aaae..094a60ade 100644 --- a/src/hwmon.c +++ b/src/hwmon.c @@ -2115,6 +2115,13 @@ static int hm_ADL_Overdrive_PowerControl_Set (hashcat_ctx_t *hashcat_ctx, int iA return -1; } + if (step == 0) + { + event_log_error (hashcat_ctx, "ADL PowerControl step invalid"); + + return -1; + } + if (level % step != 0) { event_log_error (hashcat_ctx, "ADL PowerControl step invalid");