File tree 1 file changed +6
-9
lines changed
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
8157
8157
PHP_OPENSSL_CHECK_LONG_TO_INT_NULL_RETURN (buffer_length , length );
8158
8158
PHP_OPENSSL_RAND_ADD_TIME ();
8159
8159
if (RAND_bytes ((unsigned char * )ZSTR_VAL (buffer ), (int )buffer_length ) <= 0 ) {
8160
+ php_openssl_store_errors ();
8160
8161
zend_string_release_ex (buffer , 0 );
8161
8162
zend_throw_exception (zend_ce_exception , "Error reading from source device" , 0 );
8162
8163
return NULL ;
8163
- } else {
8164
- php_openssl_store_errors ();
8165
8164
}
8166
8165
8167
8166
return buffer ;
@@ -8178,17 +8177,15 @@ PHP_FUNCTION(openssl_random_pseudo_bytes)
8178
8177
RETURN_THROWS ();
8179
8178
}
8180
8179
8181
- if (zstrong_result_returned ) {
8182
- ZEND_TRY_ASSIGN_REF_FALSE (zstrong_result_returned );
8183
- }
8184
-
8185
8180
if ((buffer = php_openssl_random_pseudo_bytes (buffer_length ))) {
8186
8181
ZSTR_VAL (buffer )[buffer_length ] = 0 ;
8187
8182
RETVAL_NEW_STR (buffer );
8188
- }
8189
8183
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 );
8192
8189
}
8193
8190
}
8194
8191
/* }}} */
You can’t perform that action at this time.
0 commit comments