diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-08-09 15:02:06 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-08-09 15:03:40 +0200 |
commit | 699b465da20fcb25747b3e1bad2e9f84a9d6d8b0 (patch) | |
tree | 54fab9e184c54912a2e80d4db0c44279e3777306 | |
parent | 1456467cfe19379150a06592d9362091d443d255 (diff) | |
download | php-git-699b465da20fcb25747b3e1bad2e9f84a9d6d8b0.tar.gz |
Fixed bug #78391
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | ext/openssl/openssl.c | 2 | ||||
-rw-r--r-- | ext/openssl/tests/bug78391.phpt | 13 |
3 files changed, 18 insertions, 1 deletions
@@ -6,6 +6,10 @@ PHP NEWS . Fixed bug #78383 (Casting a DateTime to array no longer returns its properties). (Nikita) +- OpenSSL: + . Fixed bug #78391 (Assertion failure in openssl_random_pseudo_bytes). + (Nikita) + 08 Aug 2019, PHP 7.4.0beta2 - Core: diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index b8acb79f6c..f566d4e6ed 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -6974,7 +6974,7 @@ PHP_FUNCTION(openssl_random_pseudo_bytes) zend_long buffer_length; zval *zstrong_result_returned = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|z/", &buffer_length, &zstrong_result_returned) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|z", &buffer_length, &zstrong_result_returned) == FAILURE) { return; } diff --git a/ext/openssl/tests/bug78391.phpt b/ext/openssl/tests/bug78391.phpt new file mode 100644 index 0000000000..936ef262b2 --- /dev/null +++ b/ext/openssl/tests/bug78391.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #78391: Assertion failure in openssl_random_pseudo_bytes +--FILE-- +<?php + +$isStrongCrypto = false; +var_dump(strlen(openssl_random_pseudo_bytes(16, $isStrongCrypto))); +var_dump($isStrongCrypto); + +?> +--EXPECT-- +int(16) +bool(true) |