Bug #74556 [ReO]: stream_socket_get_name returns \0 string instead of false
| From: | pollita@php.net | Date: | Tue, 19 Dec 2017 18:02:30 +0000 |
| Subject: | Bug #74556 [ReO]: stream_socket_get_name returns \0 string instead of false | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-213170@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74556&edit=1
ID: 74556
Updated by: pollita@php.net
Reported by: cpuidle at gmx dot de
Summary: stream_socket_get_name returns \0 string instead of
false
Status: Re-Opened
Type: Bug
Package: Streams related
Operating System: macOS
PHP Version: 7.1.7
Assigned To: pollita
Block user comment: N
Private report: N
New Comment:
Hrmmm.... Multiple layered things here.
How about:
if ((ZSTR_LEN(name) == 0) ||
((ZSTR_LEN(name) == 1) && (ZSTR_VAL(name)[0] == 0))) {
zend_string_release(name);
RETURN_FALSE;
}
That would return anything using an actual abstract socket path "\0/tmp/foo" but deal with
the case where Mac returns "\0" for an unbound name,
Previous Comments:
------------------------------------------------------------------------
[2017-12-18 00:12:43] kelunik@php.net
The provided fix is incomplete / wrong. It breaks sockets using the abstract socket namespace on
Linux. https://3v4l.org/RtaV2
------------------------------------------------------------------------
[2017-10-07 14:41:48] pollita@php.net
You're welcome, and for the record: Thank you for the detailed bug report. It was the details
which meant it was (initially) fixed in 20 days instead of 200. :)
------------------------------------------------------------------------
[2017-10-07 14:21:58] cpuidle at gmx dot de
@kelunik was faster than me and @pollita ever faster at fixing.
Much appreciated, thank you :)
------------------------------------------------------------------------
[2017-10-07 14:16:33] pollita@php.net
=============
ATTENTION!!!!
=============
THIS BUG HAS BEEN FIXED (we hope).
PLEASE REFERENCE THE ABOVE LINK TO GIT.PHP.NET FOR DETAILS ABOUT THE FIX.
=============
ATTENTION!!!!
=============
------------------------------------------------------------------------
[2017-10-07 14:15:04] pollita@php.net
Automatic comment on behalf of pollita
Revision: http://git.php.net/?p=php-src.git;a=commit;h=843e492c6816fa18eff83a7a3e8c370531796912
Log: Bugfix #74556 stream_socket_get_name() returns null bytes on MacOS
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=74556
--
Edit this bug report at https://bugs.php.net/bug.php?id=74556&edit=1