File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -8157,11 +8157,10 @@ PHP_OPENSSL_API zend_string* php_openssl_random_pseudo_bytes(zend_long buffer_le
81578157 PHP_OPENSSL_CHECK_LONG_TO_INT_NULL_RETURN (buffer_length , length );
81588158 PHP_OPENSSL_RAND_ADD_TIME ();
81598159 if (RAND_bytes ((unsigned char * )ZSTR_VAL (buffer ), (int )buffer_length ) <= 0 ) {
8160+ php_openssl_store_errors ();
81608161 zend_string_release_ex (buffer , 0 );
81618162 zend_throw_exception (zend_ce_exception , "Error reading from source device" , 0 );
81628163 return NULL ;
8163- } else {
8164- php_openssl_store_errors ();
81658164 }
81668165
81678166 return buffer ;
@@ -8178,17 +8177,15 @@ PHP_FUNCTION(openssl_random_pseudo_bytes)
81788177 RETURN_THROWS ();
81798178 }
81808179
8181- if (zstrong_result_returned ) {
8182- ZEND_TRY_ASSIGN_REF_FALSE (zstrong_result_returned );
8183- }
8184-
81858180 if ((buffer = php_openssl_random_pseudo_bytes (buffer_length ))) {
81868181 ZSTR_VAL (buffer )[buffer_length ] = 0 ;
81878182 RETVAL_NEW_STR (buffer );
8188- }
81898183
8190- if (zstrong_result_returned ) {
8191- ZEND_TRY_ASSIGN_REF_TRUE (zstrong_result_returned );
8184+ if (zstrong_result_returned ) {
8185+ ZEND_TRY_ASSIGN_REF_TRUE (zstrong_result_returned );
8186+ }
8187+ } else if (zstrong_result_returned ) {
8188+ ZEND_TRY_ASSIGN_REF_FALSE (zstrong_result_returned );
81928189 }
81938190}
81948191/* }}} */
You can’t perform that action at this time.
0 commit comments