[php-src] PR #22431: soap: do not overwrite the parsed host on a protocol-relative redirect
| From: | iliaal | Date: | Wed, 24 Jun 2026 11:22:22 +0000 |
| Subject: | [php-src] PR #22431: soap: do not overwrite the parsed host on a protocol-relative redirect | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36597@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22431
Author: iliaal
When a redirect Location is a protocol-relative reference (//host/path), the URI parser already
fills new_uri->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 (valgrind:
40 bytes definitely lost, traced to the Location parse) and pins the redirect back to the original
host instead of the one the server named. Inherit host and port from the request URI only when
new_uri->host is NULL, mirroring the scheme guard directly above. Follow-up to the scheme-less
redirect handling added in #22341.