Stream socket with remote address leads to a segmentation fault

Bug #72439 Stream socket with remote address leads to a segmentation fault
Submitted: 2016-06-17 12:54 UTC Modified: -
Votes:3
Avg. Score:3.7 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: ivan dot enderlin at hoa-project dot net Assigned:
Status: Closed Package: Streams related
PHP Version: 5.6.22 OS:
Private report: No CVE-ID: None

 [2016-06-17 12:54 UTC] ivan dot enderlin at hoa-project dot net

Description:
------------
There is a regression between 5.5 and 5.6. When using `stream_socket_recvfrom` or `stream_socket_sendto`, we can use the remote address. When we do, a segfault happens. When we avoid using it, everything is normal.

Test script:
---------------
// server.php

<?php

$server = stream_socket_server('tcp://127.0.0.1:1234');
$client = stream_socket_accept($server);

$message = stream_socket_recvfrom($client, 6, 0, $address);
var_dump($message);

fclose($client);
fclose($server);

// client.php

<?php

$client = stream_socket_client('tcp://127.0.0.1:1234');
stream_socket_sendto($client, 'foobar');

// shell
Run `server.php` and then `client.php` side-by-side.

Expected result:
----------------
string(6) "foobar"

Actual result:
--------------
segmentation fault!

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports