com php-src: Fix bug #77646: NEWS ext/sodium/libsodium.c
| From: | Frank Denis | Date: | Thu, 21 Feb 2019 15:33:03 +0000 |
| Subject: | com php-src: Fix bug #77646: NEWS ext/sodium/libsodium.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-104811@lists.php.net to get a copy of this message | ||
Commit: 08089b575bdd0d7a99c016a31d06444f35084f7d
Author: Frank Denis <github@pureftpd.org> Thu, 21 Feb 2019 16:10:27 +0100
Parents: 934691fabba00b2cc36a7a0c93279d41f399c7ba
Branches: PHP-7.2
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=08089b575bdd0d7a99c016a31d06444f35084f7d
Log:
Fix bug #77646
Bugs:
https://bugs.php.net/77646
Changed paths:
M NEWS
M ext/sodium/libsodium.c
Diff:
diff --git a/NEWS b/NEWS
index 72d8fac..b1280cc 100644
--- a/NEWS
+++ b/NEWS
@@ -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). (Frank)
+
07 Mar 2019, PHP 7.2.16
- Core:
diff --git a/ext/sodium/libsodium.c b/ext/sodium/libsodium.c
index cfa5b7d..f7b3ea4 100644
--- a/ext/sodium/libsodium.c
+++ b/ext/sodium/libsodium.c
@@ -1678,7 +1678,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_STR(signature);
}