fix endless loop when seed wraps around from 0 to 0xffffffff

the issue could be experienced when the full brute-force space
till the unix epoch was searched.

test with: --start 02/1970 --end 01/1970
This commit is contained in:
rofl0r 2017-10-09 22:35:19 +01:00
parent 80f7774e98
commit 1e69706bb9

View File

@ -106,9 +106,14 @@ static void* crack_thread(void *arg) {
DEBUG_PRINT("Seed found"); DEBUG_PRINT("Seed found");
} }
if(seed == 0) break;
seed--; seed--;
if(seed < j->start - SECS_PER_JOB_BLOCK) { if(seed < j->start - SECS_PER_JOB_BLOCK) {
j->start -= SECS_PER_JOB_BLOCK * job_control.jobs; long long tmp = j->start - SECS_PER_JOB_BLOCK * job_control.jobs;
if(tmp < 0) break;
j->start = tmp;
seed = j->start; seed = j->start;
if (seed < limit) break; if (seed < limit) break;
} }