php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
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
 [2016-06-19 04:34 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c4c1993af63fe4c0d19d44ebbd38996471c141af
Log: Fixed bug #72439 (Stream socket with remote address leads to a segmentation fault)
 [2016-06-19 04:34 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2016-06-22 05:58 UTC] krakjoe@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c4c1993af63fe4c0d19d44ebbd38996471c141af
Log: Fixed bug #72439 (Stream socket with remote address leads to a segmentation fault)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 12:01:29 2024 UTC