Explorar el Código

Fix buffer overlow when checking hashed passwords

svn:r4308
Nick Mathewson hace 20 años
padre
commit
9f24078452
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/or/control.c

+ 1 - 1
src/or/control.c

@@ -481,7 +481,7 @@ decode_hashed_password(char *buf, const char *hashed)
       }
   }
   if (buf)
-    memcpy(buf, decoded, sizeof(decoded));
+    memcpy(buf, decoded, S2K_SPECIFIER_LEN+DIGEST_LEN);
   return 0;
 }