|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74458 stream_socket_get_name returns \0 instead of false
Submitted: 2017-04-17 10:06 UTC Modified: 2017-05-08 15:32 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: cpuidle at gmx dot de Assigned:
Status: Closed Package: Streams related
PHP Version: 7.1.4 OS: OSX
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: cpuidle at gmx dot de
New email:
PHP Version: OS:


 [2017-04-17 10:06 UTC] cpuidle at gmx dot de
stream_socket_get_name should return false rather than a \0 string:

<pre class='xdebug-var-dump' dir='ltr'>
<small>/Users/andig/Documents/htdocs/vz/vendor/react/socket/src/Connection.php:44:</small><small>string</small> <font color='#cc0000'>'&#0;'</font> <i>(length=1)</i>

Test script:
$address = @stream_socket_get_name($stream, true);

Expected result:
return false

Actual result:
return ''.\0.''


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-17 10:07 UTC] cpuidle at gmx dot de
Same behaviour with php 7.1.3
 [2017-04-17 11:26 UTC] cpuidle at gmx dot de
Internally, stream_socket_get_name ( calls php_stream_xport_get_name (

The observed \0 string seems to be a returned empty C string buffer not further checked?
 [2017-05-08 15:32 UTC] cpuidle at gmx dot de
-Status: Open +Status: Closed
 [2017-05-08 15:32 UTC] cpuidle at gmx dot de
Superseeded by
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 14:01:29 2024 UTC