Permalink
Browse files

Merge pull request for fixing buffer creation with xor

  • Loading branch information...
2 parents 711bee2 + a7d7b40 commit 743710e7d6e463bc4f0a3f1151334e93e8f72050 @ircmaxell committed Sep 18, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/password.php
View
@@ -118,7 +118,7 @@ function password_hash($password, $algo, array $options = array()) {
$bl = strlen($buffer);
for ($i = 0; $i < $raw_length; $i++) {
if ($i < $bl) {
- $buffer[$i] ^= chr(mt_rand(0, 255));
+ $buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255));
} else {
$buffer .= chr(mt_rand(0, 255));
}

0 comments on commit 743710e

Please sign in to comment.