From 6b96146e0f7bb1fd484f4ed908863cecd79c3240 Mon Sep 17 00:00:00 2001 From: jsteube Date: Fri, 21 Oct 2016 00:28:14 +0200 Subject: [PATCH] Fix integer overflow in status.c --- src/status.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/status.c b/src/status.c index 74aa248d9..0f539a67f 100644 --- a/src/status.c +++ b/src/status.c @@ -753,6 +753,14 @@ char *status_get_time_estimated_absolute (const hashcat_ctx_t *hashcat_ctx) } } + // we need this check to avoid integer overflow + #if defined (_WIN) + if (sec_etc > 100000000) + { + sec_etc = 100000000; + } + #endif + time_t now; time (&now); @@ -803,6 +811,14 @@ char *status_get_time_estimated_relative (const hashcat_ctx_t *hashcat_ctx) } } + // we need this check to avoid integer overflow + #if defined (_WIN) + if (sec_etc > 100000000) + { + sec_etc = 100000000; + } + #endif + struct tm *tmp; #if defined (_WIN)