From 69a771346a649d993cc19362f3966a8f59e95d75 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 9 Aug 2019 15:02:06 +0200 Subject: [PATCH] Fixed bug #78391 --- NEWS | 4 ++++ ext/openssl/openssl.c | 2 +- ext/openssl/tests/bug78391.phpt | 13 +++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 ext/openssl/tests/bug78391.phpt diff --git a/NEWS b/NEWS index 21c109430f..ff22389e0e 100644 --- a/NEWS +++ b/NEWS @@ -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-- + +--EXPECT-- +int(16) +bool(true) -- 2.50.1