mirror of
https://github.com/php/php-src.git
synced 2026-04-14 11:32:11 +02:00
A recent commit[1] which fixed a memory leak introduced a regression regarding the formerly liberal handling of IP addresses to bind to. We fix this by reverting that commit, and fix the memory leak where it actually occurs. In other words, this fix is less intrusive than the former fix. [1] <http://git.php.net/?p=php-src.git;a=commit;h=0b8c83f5936581942715d14883cdebddc18bad30> Closes GH-6104.
19 lines
627 B
PHP
19 lines
627 B
PHP
--TEST--
|
|
Test invalid bindto
|
|
--FILE--
|
|
<?php
|
|
$ctx = stream_context_create([
|
|
'socket' => [
|
|
'bindto' => 'invalid',
|
|
],
|
|
]);
|
|
$fp = stream_socket_client(
|
|
'tcp://www.' . str_repeat('x', 100) . '.com:80',
|
|
$errno, $errstr, 30, STREAM_CLIENT_CONNECT, $ctx
|
|
);
|
|
?>
|
|
--EXPECTF--
|
|
Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: %s in %s on line %d
|
|
|
|
Warning: stream_socket_client(): unable to connect to tcp://www.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.com:80 (php_network_getaddresses: getaddrinfo failed: %s) in %s on line %d
|