File tree Expand file tree Collapse file tree 3 files changed +5
-8
lines changed
Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ PHP NEWS
2828
2929- OpenSSL:
3030 . Fix a bunch of memory leaks and crashes on edge cases. (ndossche)
31+ . Fixed bug GH-18988 (Check various unchecked error-prone OpenSSL function
32+ return values). (alexandre-daubois)
3133
3234- SPL:
3335 . Fixed bug GH-21499 (RecursiveArrayIterator getChildren UAF after parent
Original file line number Diff line number Diff line change @@ -1303,7 +1303,6 @@ PHP_MINIT_FUNCTION(openssl)
13031303#endif
13041304 if (OPENSSL_init_ssl (OPENSSL_INIT_LOAD_CONFIG , NULL ) != 1 ) {
13051305 php_error_docref (NULL , E_WARNING , "Failed to initialize OpenSSL" );
1306- return FAILURE ;
13071306 }
13081307#endif
13091308
@@ -2330,10 +2329,7 @@ static STACK_OF(X509) *php_openssl_load_all_certs_from_file(
23302329 while (sk_X509_INFO_num (sk )) {
23312330 xi = sk_X509_INFO_shift (sk );
23322331 if (xi -> x509 != NULL ) {
2333- if (sk_X509_push (stack ,xi -> x509 ) == 0 ) {
2334- php_openssl_store_errors ();
2335- X509_free (xi -> x509 );
2336- }
2332+ sk_X509_push (stack ,xi -> x509 );
23372333 xi -> x509 = NULL ;
23382334 }
23392335 X509_INFO_free (xi );
Original file line number Diff line number Diff line change @@ -1851,9 +1851,8 @@ static zend_result php_openssl_setup_crypto(php_stream *stream,
18511851 php_error_docref (NULL , E_WARNING , "Supplied session stream must be an SSL enabled stream" );
18521852 } else if (((php_openssl_netstream_data_t * )cparam -> inputs .session -> abstract )-> ssl_handle == NULL ) {
18531853 php_error_docref (NULL , E_WARNING , "Supplied SSL session stream is not initialized" );
1854- } else if (SSL_copy_session_id (sslsock -> ssl_handle , ((php_openssl_netstream_data_t * )cparam -> inputs .session -> abstract )-> ssl_handle ) != 1 ) {
1855- php_openssl_store_errors ();
1856- php_error_docref (NULL , E_WARNING , "Failed to copy SSL session" );
1854+ } else {
1855+ SSL_copy_session_id (sslsock -> ssl_handle , ((php_openssl_netstream_data_t * )cparam -> inputs .session -> abstract )-> ssl_handle );
18571856 }
18581857 }
18591858
You can’t perform that action at this time.
0 commit comments