Bug #74458 [Opn->Csd]: stream_socket_get_name returns \0 instead of false

From: Date: Mon, 08 May 2017 15:32:50 +0000
Subject: Bug #74458 [Opn->Csd]: stream_socket_get_name returns \0 instead of false
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209000@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74458&edit=1 ID: 74458 User updated by: cpuidle at gmx dot de Reported by: cpuidle at gmx dot de Summary: stream_socket_get_name returns \0 instead of false -Status: Open +Status: Closed Type: Bug Package: Streams related Operating System: OSX PHP Version: 7.1.4 Block user comment: N Private report: N New Comment: Superseeded by https://bugs.php.net/bug.php?id=74556 Previous Comments: ------------------------------------------------------------------------ [2017-04-17 11:26:59] cpuidle at gmx dot de Internally, stream_socket_get_name (https://lxr.room11.org/xref/php-src%407.1/ext/standard/streamsfuncs.c) calls php_stream_xport_get_name (https://lxr.room11.org/source/s?refs=php_stream_xport_get_name&project=php-src@7.1). The observed \0 string seems to be a returned empty C string buffer not further checked? ------------------------------------------------------------------------ [2017-04-17 10:07:12] cpuidle at gmx dot de Same behaviour with php 7.1.3 ------------------------------------------------------------------------ [2017-04-17 10:06:42] cpuidle at gmx dot de Description: ------------ 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> </pre> Test script: --------------- $address = @stream_socket_get_name($stream, true); ob_start(); var_dump($address); $s=ob_get_clean(); error_log($s); Expected result: ---------------- return false Actual result: -------------- return ''.\0.'' ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74458&edit=1

« previous php.bugs (#209000) next »