[pull] master from php:master#1031
Merged
Merged
Conversation
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).
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
…e with php_openssl_get_evp_md_by_name (#21965)
…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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )