Skip to content

Commit 699b465

Browse files
committed
Fixed bug #78391
1 parent 1456467 commit 699b465

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ PHP NEWS
66
. Fixed bug #78383 (Casting a DateTime to array no longer returns its
77
properties). (Nikita)
88

9+
- OpenSSL:
10+
. Fixed bug #78391 (Assertion failure in openssl_random_pseudo_bytes).
11+
(Nikita)
12+
913
08 Aug 2019, PHP 7.4.0beta2
1014

1115
- Core:

ext/openssl/openssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6974,7 +6974,7 @@ PHP_FUNCTION(openssl_random_pseudo_bytes)
69746974
zend_long buffer_length;
69756975
zval *zstrong_result_returned = NULL;
69766976

6977-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|z/", &buffer_length, &zstrong_result_returned) == FAILURE) {
6977+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|z", &buffer_length, &zstrong_result_returned) == FAILURE) {
69786978
return;
69796979
}
69806980

ext/openssl/tests/bug78391.phpt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--TEST--
2+
Bug #78391: Assertion failure in openssl_random_pseudo_bytes
3+
--FILE--
4+
<?php
5+
6+
$isStrongCrypto = false;
7+
var_dump(strlen(openssl_random_pseudo_bytes(16, $isStrongCrypto)));
8+
var_dump($isStrongCrypto);
9+
10+
?>
11+
--EXPECT--
12+
int(16)
13+
bool(true)

0 commit comments

Comments
 (0)