From d0f0bf5a486b8b55d641b9d8e2811b866d3b84c9 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Wed, 15 Jun 2016 20:01:23 +0200 Subject: [PATCH] throw error when bug is triggered where no tries are performed than should be --- hydra.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hydra.c b/hydra.c index 531a5be..5b9a49d 100644 --- a/hydra.c +++ b/hydra.c @@ -3917,6 +3917,8 @@ int main(int argc, char *argv[]) { for (j = 0; j < hydra_options.max_use; j++) if (hydra_heads[j]->active >= 0) k++; + if ((long)(hydra_brains.todo_all - hydra_brains.sent) <= 0) //in case of overflow of unsigned "-1" + bail("Weird bug detected where more tests were performed than possible. Please post your command line here: https://github.com/vanhauser-thc/thc-hydra/issues/113 or send it in an email to vh@thc.org") printf("[STATUS] %.2f tries/min, %lu tries in %02lu:%02luh, %lu to do in %02lu:%02luh, %d active\n", (1.0 * hydra_brains.sent) / (((elapsed_status - starttime) * 1.0) / 60), // tries/min hydra_brains.sent, // tries (long unsigned int) ((elapsed_status - starttime) / 3600), // hours