File tree Expand file tree Collapse file tree 4 files changed +32
-1
lines changed Expand file tree Collapse file tree 4 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 5
5
- Core:
6
6
. Fixed bug #74658 (Undefined constants in array properties result in broken
7
7
properties). (Laruence)
8
+ . Fixed misparsing of abstract unix domain socket names. (Sara)
8
9
9
10
- Opcache:
10
11
. Fixed bug #74663 (Segfault with opcache.memory_protect and
@@ -17,6 +18,9 @@ PHP NEWS
17
18
- FTP:
18
19
. Fixed bug #74598 (ftp:// wrapper ignores context arg). (Sara)
19
20
21
+ - Streams:
22
+ . Fixed bug #74556 (stream_socket_get_name() returns '\0'). (Sara)
23
+
20
24
8 Jun 2017, PHP 7.1.6
21
25
22
26
- Core:
Original file line number Diff line number Diff line change @@ -314,6 +314,11 @@ PHP_FUNCTION(stream_socket_get_name)
314
314
RETURN_FALSE ;
315
315
}
316
316
317
+ if (!ZSTR_LEN (name )) {
318
+ zend_string_release (name );
319
+ RETURN_FALSE ;
320
+ }
321
+
317
322
RETVAL_STR (name );
318
323
}
319
324
/* }}} */
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #74556 stream_socket_get_name() on unix socket returns "\0"
3
+ --SKIPIF--
4
+ <?php
5
+ if (!strncasecmp (PHP_OS , 'WIN ' , 3 )) echo "skip Unix Only " ;
6
+ --FILE --
7
+ <?php
8
+
9
+ $ sock = __DIR__ . '/bug74556.sock ' ;
10
+ $ s = stream_socket_server ("unix:// $ sock " );
11
+ $ c = stream_socket_client ("unix:// $ sock " );
12
+
13
+ var_dump (
14
+ stream_socket_get_name ($ s , true ),
15
+ stream_socket_get_name ($ c , false )
16
+ );
17
+ --CLEAN --
18
+ <?php
19
+ unlink (__DIR__ . '/bug74556.sock ' );
20
+ --EXPECT --
21
+ bool (false )
22
+ bool (false )
Original file line number Diff line number Diff line change @@ -661,7 +661,7 @@ PHPAPI void php_network_populate_name_from_sockaddr(
661
661
662
662
if (ua -> sun_path [0 ] == '\0' ) {
663
663
/* abstract name */
664
- int len = strlen ( ua -> sun_path + 1 ) + 1 ;
664
+ int len = sl - sizeof ( sa_family_t ) ;
665
665
* textaddr = zend_string_init ((char * )ua -> sun_path , len , 0 );
666
666
} else {
667
667
int len = strlen (ua -> sun_path );
You can’t perform that action at this time.
0 commit comments