Skip to content

[pull] master from php:master#1031

Merged
pull[bot] merged 15 commits into
turkdevops:masterfrom
php:master
Jun 25, 2026
Merged

[pull] master from php:master#1031
pull[bot] merged 15 commits into
turkdevops:masterfrom
php:master

Conversation

@pull

@pull pull Bot commented Jun 25, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

iliaal and others added 15 commits June 24, 2026 13:16
When a redirect Location is a protocol-relative reference (//host/path),
php_url_parse() already fills new_url->host, but the scheme-less redirect
handling overwrote it with a copy of the request host without releasing
the parsed one. That leaks a zend_string per such redirect and pins the
redirect back to the original host instead of the one the server named.
Inherit host and port from the request URL only when new_url->host is
NULL, mirroring the scheme guard directly above.

Closes GH-22434
* PHP-8.4:
  [ci skip] Update heading
  soap: do not overwrite the parsed host on a protocol-relative redirect
* PHP-8.5:
  [ci skip] Update heading
  soap: do not overwrite the parsed host on a protocol-relative redirect
…l_x509_read() (#21953)

Otherwise x509 field is NULL and can cause a NULL deref which is UB (and
causes a SEGV).
* PHP-8.4:
  openssl: Use proper error propagation when X509_dup() fails in openssl_x509_read() (#21953)
  Fixing memory leak in openssl_x509_parse when str_serial creation fails (#21751)
* PHP-8.5:
  openssl: Use proper error propagation when X509_dup() fails in openssl_x509_read() (#21953)
  Fixing memory leak in openssl_x509_parse when str_serial creation fails (#21751)
This commit introduces three new zend_always_inline helpers to 
Zend/zend_string.hfor concatenating raw C strings (char *), 
which is discussed before in #21597.

- zend_str_append_char_to_raw
- zend_str_concat_to_raw
- zend_str_concat3_to_raw

Now, several places in the codebase has manual emalloc + 
memcpy + \0 boilerplate to generate temporary char *. This 
manual approach is verbose, and harder to read. In some cases 
when we actually need a zend_string instead of char *, we 
already has some refactors (#21564 and #21567) by using 
zend_string_concat* API, but when it comes to char *, the API 
forces a 24-byte struct allocation, which is immediately 
discarded, and will unnecessarily lower performance. In order 
to solve this, I think we can introduce three APIs focusing on 
dealing with chars * refactoring.
…ils (#21752)

* Fixing memory leak

* Simplified cleanup and adding test
…hing cipher with php_openssl_get_evp_cipher_by_name (#21967)
* PHP-8.4:
  Fixing memory leak in openssl_pkcs12_read when zout initialisation fails (#21752)
* PHP-8.5:
  Fixing memory leak in zif_openssl_seal and zif_openssl_open when fetching cipher with php_openssl_get_evp_cipher_by_name (#21967)
  Fixing memory leak in php_openssl_x509_fingerprint when getting mdtype with php_openssl_get_evp_md_by_name (#21965)
  Fixing memory leak in openssl_pkcs12_read when zout initialisation fails (#21752)
@pull pull Bot locked and limited conversation to collaborators Jun 25, 2026
@pull pull Bot added the ⤵️ pull label Jun 25, 2026
@pull pull Bot merged commit eeb02a0 into turkdevops:master Jun 25, 2026
1 check failed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants