]> granicus.if.org Git - php/commitdiff
Bugfix #74556 stream_socket_get_name() returns null bytes on MacOS
authorSara Golemon <pollita@php.net>
Sat, 7 Oct 2017 14:08:34 +0000 (10:08 -0400)
committerSara Golemon <pollita@php.net>
Sat, 7 Oct 2017 14:08:34 +0000 (10:08 -0400)
ext/standard/streamsfuncs.c

index 877247e8ebc8fdb3630ffb6feb9b4411a1895908..fcfa4a00c3d0bf69fc212b7ea25518998d6ea4e9 100644 (file)
@@ -314,7 +314,7 @@ PHP_FUNCTION(stream_socket_get_name)
                RETURN_FALSE;
        }
 
-       if (!ZSTR_LEN(name)) {
+       if ((ZSTR_LEN(name) == 0) || (ZSTR_VAL(name)[0] == 0)) {
                zend_string_release(name);
                RETURN_FALSE;
        }