Commit Graph

4825 Commits

Author SHA1 Message Date
Sara Golemon
a9e8239f45 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Do not allow using traits/interfaces/abstract classes as stream wrappers
2017-07-19 14:01:00 -04:00
Sara Golemon
c9fd093127
Do not allow using traits/interfaces/abstract classes as stream wrappers
Fixes https://bugs.php.net/bug.php?id=74951
2017-07-19 14:00:00 -04:00
Dmitry Stogov
4252f14299 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Reset globals on startup or restart
2017-07-19 15:36:24 +03:00
Dmitry Stogov
e5beb4e828 Reset globals on startup or restart 2017-07-19 15:35:10 +03:00
Joe Watkins
f4323248ec
bump versions 2017-07-18 17:21:19 +01:00
Anatol Belski
649027b963 move to 7.0.23 for dev 2017-07-18 10:25:40 +02:00
Joe Watkins
78bec63ad9
bump versions 2017-06-20 17:34:00 +01:00
Anatol Belski
b4fa2ba295 move next 2017-06-20 14:05:50 +02:00
Xinchen Hui
caf35c5cf5 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Add simple cli test for PATH/HOST ini sections
  Fixed bug #74600
2017-06-12 17:21:35 +08:00
Manuel Mausz
ee0e6963f3 Fixed bug #74600
Make sure the hash entry is an array.

The origin fix broke support for HOST/PATH ini sections. Only the
beginning of the string has to match. Revert this check but use
zend_binary_strncasecmp instead of strncasecmp.
2017-06-09 01:43:08 +02:00
Sara Golemon
e628ee9e9d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Bugfix #74556 stream_socket_get_name() returns empty string
  Fix abstract name handling to be binary safe
2017-05-28 08:49:25 -07:00
Sara Golemon
6d2d0bbda7 Fix abstract name handling to be binary safe
Per unix(7):
abstract: an abstract socket address is distinguished (from a
pathname socket) by the fact that sun_path[0] is a null byte
('\0').  The socket's address in this namespace is given by the
additional bytes in sun_path that are covered by the specified
length of the address structure.  (Null bytes in the name have no
special significance.)  The name has no connection with filesystem
pathnames.  When the address of an abstract socket is returned,
the returned addrlen is greater than sizeof(sa_family_t) (i.e.,
greater than 2), and the name of the socket is contained in the
first (addrlen - sizeof(sa_family_t)) bytes of sun_path.

The existing implementation was assuming significance in null bytes
contained in the abstract address identifier.
2017-05-28 08:45:44 -07:00
Joe Watkins
e535b80257
bump versions 2017-05-23 22:04:01 +01:00
Anatol Belski
fff1cab367 time to move next 2017-05-23 12:31:03 +02:00
Xinchen Hui
c667bb94fa Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74600 (crash (SIGSEGV) in _zend_hash_add_or_update_i)
2017-05-16 19:32:59 +08:00
Xinchen Hui
9f49ebb5ba Fixed bug #74600 (crash (SIGSEGV) in _zend_hash_add_or_update_i) 2017-05-16 19:32:13 +08:00
Jakub Zelenka
9622a3be43 Merge branch 'PHP-7.0' into PHP-7.1 2017-04-30 20:27:39 +01:00
Michael Heimpold
d9dfac90bf Fix compiler warnings when compiled against musl libc
musl libc is complaining when <sys/poll.h> is used instead of <poll.h>
so change this.

This issue was reported for OpenWrt/LEDE where musl libc is the standard
C library instead of e.g. glibc, see the following link for the original PR:
https://github.com/openwrt/packages/pull/4263

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Michael Heimpold <mhei@heimpold.de>

--

v3: refined checks/fallback paths as suggested by @bukka

v2: rebased to resolve merge conflict in main/php_network.h

v1: initial PR
2017-04-30 20:24:56 +01:00
Anatol Belski
392bcba58d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Revert "Detect invalid port in xp_socket parse ip address"
  Revert "Follow up patch regarding bug #74216, see bug #74429"
2017-04-27 11:11:41 +02:00
Anatol Belski
09ef61e3ca Revert "Detect invalid port in xp_socket parse ip address"
This reverts commit bab0b99f37.
2017-04-27 02:49:12 +02:00
Anatol Belski
bf3e2dce7b Revert "Follow up patch regarding bug #74216, see bug #74429"
This reverts commit cda7dcf4ca.
2017-04-27 02:49:01 +02:00
Joe Watkins
91a0d48675
bump version after release 2017-04-25 16:49:20 +01:00
Anatol Belski
53a702c020 move next 2017-04-25 14:06:17 +02:00
Anatol Belski
faf19a7756 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Follow up patch regarding bug #74216, see bug #74429
2017-04-25 12:59:22 +02:00
Sara Golemon
cda7dcf4ca Follow up patch regarding bug #74216, see bug #74429
While the case in bug #74429 is not documented and is only worky due to
an implementation bug, the strength seems to breach some real world
apps. Given this patch doesn't impact the initial security fix for
bug #74216, it is reasonable to let the apps keep working. As mentioned
in the ticket, this behavior is a subject to change in future versions
and should not be abused.
2017-04-25 12:52:48 +02:00
Anatol Belski
91cb9a6ad1 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  #74337 pointer returned by php_stream_fopen_tmpfile not validated in memory.c
2017-04-22 21:58:10 +02:00
Anton Serbulov
793a8bd886 #74337 pointer returned by php_stream_fopen_tmpfile not validated in memory.c 2017-04-22 21:56:37 +02:00
Joe Watkins
242bdf7e8b
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Update php_network.h
2017-04-20 06:39:26 +01:00
Alexander Ilyin
464742bd2a
Update php_network.h
```
In file included from /usr/local/include/php/main/php_network.h:124:0,
                 from /var/www/html/php-ext-handlersocketi-0.0.1/hs_response.c:3:
/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
 #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
  ^
```
2017-04-20 06:39:14 +01:00
Xinchen Hui
65d77812fc Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed condition check
2017-04-10 14:47:42 +08:00
Xinchen Hui
4bebcb84ad Fixed condition check 2017-04-10 14:47:24 +08:00
Xinchen Hui
d65459f4eb another place 2017-04-10 14:42:48 +08:00
Xinchen Hui
8277111eee Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed issue #2466 Invalid integer constant expression error in php.h
2017-04-10 14:41:48 +08:00
Xinchen Hui
d2923ec1e5 Fixed issue #2466 Invalid integer constant expression error in php.h 2017-04-10 14:40:44 +08:00
Joe Watkins
e38310a151
prepare next 2017-03-28 15:22:10 +01:00
Anatol Belski
ddad991c18 prepare next 2017-03-28 11:49:04 +02:00
Bob Weinand
3d4e954518 Merge branch 'PHP-7.0' into PHP-7.1 2017-03-14 22:17:10 +01:00
Bob Weinand
8be63ce0e2 Fix stream context changes leaking into copies of previous context 2017-03-14 22:15:41 +01:00
Sara Golemon
1a19b97ac3 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Detect invalid port in xp_socket parse ip address
2017-03-07 12:11:22 -08:00
Sara Golemon
bab0b99f37 Detect invalid port in xp_socket parse ip address
For historical reasons, fsockopen() accepts the port and hostname
separately: fsockopen('127.0.0.1', 80)

However, with the introdcution of stream transports in PHP 4.3,
it became possible to include the port in the hostname specifier:

fsockopen('127.0.0.1:80')
Or more formally: fsockopen('tcp://127.0.0.1:80')

Confusing results when these two forms are combined, however.
fsockopen('127.0.0.1:80', 443) results in fsockopen() attempting
to connect to '127.0.0.1:80:443' which any reasonable stack would
consider invalid.

Unfortunately, PHP parses the address looking for the first colon
(with special handling for IPv6, don't worry) and calls atoi()
from there.  atoi() in turn, simply stops parsing at the first
non-numeric character and returns the value so far.

The end result is that the explicitly supplied port is treated
as ignored garbage, rather than producing an error.

This diff replaces atoi() with strtol() and inspects the
stop character.  If additional "garbage" of any kind is found,
it fails and returns an error.
2017-03-07 12:10:53 -08:00
Joe Watkins
55bcef1751
prepare 7.1.4 2017-02-28 09:08:05 +00:00
Anatol Belski
21a05b0418 prepare next 2017-02-28 09:46:11 +01:00
Nikita Popov
846bea7f05 Merge branch 'PHP-7.0' into PHP-7.1 2017-02-25 12:57:53 +01:00
Nikita Popov
bbfa1b6419 Improve fix for bug #73807
At least on some architectures memmove() on FreeBSD does not
short-curcuit if src==dst. Check for it explicitly to avoid
quadratic copying.
2017-02-25 12:55:14 +01:00
Anatol Belski
2a61e5495a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74090 stream_get_contents maxlength>-1 returns empty string
2017-02-15 14:49:58 +01:00
Anatol Belski
89a5bd6750 Fixed bug #74090 stream_get_contents maxlength>-1 returns empty string 2017-02-15 11:22:47 +01:00
Xinchen Hui
6649aebb89 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed #73496 (Invalid memory access in zend_inline_hash_func)
2017-02-12 18:56:11 +08:00
Xinchen Hui
ee25eb0eae Fixed #73496 (Invalid memory access in zend_inline_hash_func)
no test script is added because it requre too much memory
2017-02-12 18:55:19 +08:00
Nikita Popov
6d5ea20e0b Merge branch 'PHP-7.0' into PHP-7.1 2017-02-12 00:06:35 +01:00
Denis Yeldandi
9814be4bc2 Fixed bug #69860 2017-02-12 00:06:04 +01:00