summaryrefslogtreecommitdiff
path: root/ext/standard/password.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2017-10-12 12:52:58 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2017-10-12 12:52:58 +0200
commiteb4342eb141be5a55cf32e4d3a893530564e7ffd (patch)
tree3813e1f7afba398ba8b343597e116926ca27bbdd /ext/standard/password.c
parent2392010af440583ff44b83b30685c63d21208abd (diff)
parent3f8961dfac96a992df2516c0e383e6820eedd31b (diff)
downloadphp-git-eb4342eb141be5a55cf32e4d3a893530564e7ffd.tar.gz
Merge branch 'PHP-7.2'
* PHP-7.2: Fixed bug #75221 (Argon2i always throws NUL at the end)
Diffstat (limited to 'ext/standard/password.c')
-rw-r--r--ext/standard/password.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/password.c b/ext/standard/password.c
index d6fc66c610..f49624e655 100644
--- a/ext/standard/password.c
+++ b/ext/standard/password.c
@@ -523,7 +523,7 @@ PHP_FUNCTION(password_hash)
#endif
);
- encoded = zend_string_alloc(encoded_len, 0);
+ encoded = zend_string_alloc(encoded_len - 1, 0);
status = argon2_hash(
time_cost,
memory_cost,
@@ -535,7 +535,7 @@ PHP_FUNCTION(password_hash)
ZSTR_VAL(out),
ZSTR_LEN(out),
ZSTR_VAL(encoded),
- ZSTR_LEN(encoded),
+ encoded_len,
type,
ARGON2_VERSION_NUMBER
);