mirror of
https://github.com/php/php-src.git
synced 2024-11-25 02:44:58 +08:00
Fixed bug #60106 (stream_socket_server silently truncates long unix socket paths)
This commit is contained in:
parent
9b9f05fd6e
commit
5525d80982
1
NEWS
1
NEWS
@ -45,6 +45,7 @@ PHP NEWS
|
||||
- Standard:
|
||||
. Fixed memory leak in substr_replace. (Pierrick)
|
||||
. Make max_file_uploads ini directive settable outside of php.ini (Rasmus)
|
||||
. Fixed bug #60106 (stream_socket_server silently truncates long unix socket paths). (Ilia)
|
||||
|
||||
- XMLRPC:
|
||||
. Fixed bug #61097 (Memory leak in xmlrpc functions copying zvals). (Nikita Popov)
|
||||
|
14
ext/standard/tests/streams/bug60106.phpt
Normal file
14
ext/standard/tests/streams/bug60106.phpt
Normal file
@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
Bug#60106 (stream_socket_server silently truncates long unix socket paths)
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL | E_NOTICE);
|
||||
stream_socket_server("unix:///tmp/" . str_repeat("a", 4096));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Notice: stream_socket_server(): socket path exceeded the maximum allowed length of %d bytes and was truncated in %s on line %d
|
||||
|
||||
Warning: stream_socket_server(): unable to connect to unix:///tmp/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa in %s on line %d
|
||||
===DONE===
|
||||
|
@ -510,6 +510,7 @@ static inline int parse_unix_address(php_stream_xport_param *xparam, struct sock
|
||||
* BUT, to get into this branch of code, the name is too long,
|
||||
* so we don't care. */
|
||||
xparam->inputs.namelen = sizeof(unix_addr->sun_path) - 1;
|
||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "socket path exceeded the maximum allowed length of %ld bytes and was truncated", sizeof(unix_addr->sun_path));
|
||||
}
|
||||
|
||||
memcpy(unix_addr->sun_path, xparam->inputs.name, xparam->inputs.namelen);
|
||||
|
Loading…
Reference in New Issue
Block a user