Explorar el Código

issue #54: fixed memory issue with some unicode algorithms

philsmd hace 10 años
padre
commit
a0ca82ca5a
Se han modificado 2 ficheros con 13 adiciones y 0 borrados
  1. 5 0
      docs/changes.txt
  2. 8 0
      src/engine.c

+ 5 - 0
docs/changes.txt

@@ -35,6 +35,11 @@ file.: Host
 desc.: Fixed the use of -s / -l parameters together with the attack mode -a 8 (Prince)
 issue: 40
 
+type.: Bug
+file.: Host
+desc.: Fixed a memory issue with algorithms using unicode when trying password candidates longer than 27 characters
+issue: 54
+
 type.: Bug
 file.: Host
 desc.: Fixed --help text for hash type -m 9900 = Radmin2 (was wronly displayed as -m 9800 = Radmin2)

+ 8 - 0
src/engine.c

@@ -4599,6 +4599,8 @@ void md4_final_sse2_max55 (plain_t *plains, digest_md4_sse2_t *digests)
   {
     plain_t *ptr = plains + i;
 
+    if (ptr.len >= 56) continue;
+
     memset (ptr->buf8 + ptr->len, 0, 64 - ptr->len);
 
     ptr->buf8[ptr->len] = 0x80;
@@ -4617,6 +4619,8 @@ void md5_final_sse2_max55 (plain_t *plains, digest_md5_sse2_t *digests)
   {
     plain_t *ptr = plains + i;
 
+    if (ptr->len >= 56) continue;
+
     memset (ptr->buf8 + ptr->len, 0, 64 - ptr->len);
 
     ptr->buf8[ptr->len] = 0x80;
@@ -4635,6 +4639,8 @@ void sha1_final_sse2_max55 (plain_t *plains, digest_sha1_sse2_t *digests)
   {
     plain_t *ptr = plains + i;
 
+    if (ptr->len >= 56) continue;
+
     memset (ptr->buf8 + ptr->len, 0, 64 - ptr->len);
 
     ptr->buf8[ptr->len] = 0x80;
@@ -4655,6 +4661,8 @@ void sha256_final_sse2_max55 (plain_t *plains, digest_sha256_sse2_t *digests)
   {
     plain_t *ptr = plains + i;
 
+    if (ptr->len >= 56) continue;
+
     memset (ptr->buf8 + ptr->len, 0, 64 - ptr->len);
 
     ptr->buf8[ptr->len] = 0x80;