Procházet zdrojové kódy

issue #2 related to pull request #33: this fixes a similar problem with -s / -l but in -a 0 attack mode

philsmd před 10 roky
rodič
revize
b68b559993
1 změnil soubory, kde provedl 8 přidání a 1 odebrání
  1. 8 1
      src/engine.c

+ 8 - 1
src/engine.c

@@ -16331,7 +16331,9 @@ void *attack_a0r0 (thread_parameter_t *thread_parameter)
 
     uint32_t i;
 
-    for (i = 0; i < 4; i++, words_next++)
+    uint limit = MIN (4, words_steps - words_cur);
+
+    for (i = 0; i < limit; i++, words_next++)
     {
       int next_len = words->words_len[words_next];
 
@@ -16346,6 +16348,11 @@ void *attack_a0r0 (thread_parameter_t *thread_parameter)
       plains[i].pos = thread_parameter->thread_words_done + i;
     }
 
+    for (; i < 4; i++)
+    {
+      plains[i].len = 0;
+    }
+
     thread_parameter->hashing (thread_parameter, plains);
 
     thread_parameter->thread_plains_done += 4;