diff options
author | Frank Denis <github@pureftpd.org> | 2019-02-21 16:10:27 +0100 |
---|---|---|
committer | Frank Denis <github@pureftpd.org> | 2019-02-21 16:14:33 +0100 |
commit | e7ca69f1fa6b7e7b63f40080b1a6cea3a071b034 (patch) | |
tree | 7c039991459cfab55d63f625ab813d6d2a523bcf | |
parent | e5d8ac92a481291cddf5a6879b7b83defb514c16 (diff) | |
download | php-git-e7ca69f1fa6b7e7b63f40080b1a6cea3a071b034.tar.gz |
Fix bug #77646
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | ext/sodium/libsodium.c | 3 |
2 files changed, 5 insertions, 1 deletions
@@ -5,6 +5,9 @@ PHP NEWS - MySQLi: . Fixed bug #77597 (mysqli_fetch_field hangs scripts). (Nikita) +- sodium: + . Fixed bug #77646 (sign_detached() strings not terminated). (jedisct1) + 21 Feb 2019, PHP 7.3.3 - Core: diff --git a/ext/sodium/libsodium.c b/ext/sodium/libsodium.c index 125c8b74b2..50a91198b6 100644 --- a/ext/sodium/libsodium.c +++ b/ext/sodium/libsodium.c @@ -1677,7 +1677,8 @@ PHP_FUNCTION(sodium_crypto_sign_detached) zend_throw_exception(sodium_exception_ce, "signature has a bogus size", 0); return; } - ZEND_ASSERT(ZSTR_VAL(signature)[signature_real_len] == 0); + PHP_SODIUM_ZSTR_TRUNCATE(signature, (size_t) signature_real_len); + ZSTR_VAL(signature)[signature_real_len] = 0; RETURN_NEW_STR(signature); } |