File tree Expand file tree Collapse file tree 4 files changed +30
-1
lines changed Expand file tree Collapse file tree 4 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ PHP NEWS
52
52
a fatal error). (pmmaga)
53
53
. Fixed bug #63384 (Cannot override an abstract method with an abstract
54
54
method). (pmmaga, wes)
55
+ . Fixed misparsing of abstract unix domain socket names. (Sara)
55
56
56
57
- BCMath:
57
58
. Fixed bug #46564 (bcmod truncates fractionals). (liborm85)
@@ -202,6 +203,7 @@ PHP NEWS
202
203
. Fixed bug #72979 (money_format stores wrong length AIX). (matthieu.sarter)
203
204
. Fixed bug #74300 (unserialize accepts two plus/minus signs for float number exponent part).
204
205
(xKerman)
206
+ . Fixed bug #74556 (stream_socket_get_name() returns '\0'). (Sara)
205
207
206
208
- XML:
207
209
. Moved utf8_encode() and utf8_decode() to the Standard extension. (Andrea)
Original file line number Diff line number Diff line change @@ -330,6 +330,11 @@ PHP_FUNCTION(stream_socket_get_name)
330
330
RETURN_FALSE ;
331
331
}
332
332
333
+ if (!ZSTR_LEN (name )) {
334
+ zend_string_release (name );
335
+ RETURN_FALSE ;
336
+ }
337
+
333
338
RETVAL_STR (name );
334
339
}
335
340
/* }}} */
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 @@ -649,7 +649,7 @@ PHPAPI void php_network_populate_name_from_sockaddr(
649
649
650
650
if (ua -> sun_path [0 ] == '\0' ) {
651
651
/* abstract name */
652
- int len = strlen ( ua -> sun_path + 1 ) + 1 ;
652
+ int len = sl - sizeof ( sa_family_t ) ;
653
653
* textaddr = zend_string_init ((char * )ua -> sun_path , len , 0 );
654
654
} else {
655
655
int len = strlen (ua -> sun_path );
You can’t perform that action at this time.
0 commit comments