Commit Graph

5193 Commits

Author SHA1 Message Date
Xinchen Hui
4dfbfe93aa Use cheaper API 2017-12-18 11:55:14 +08:00
David Carlier
e835e3c132 Improve explicit_bzero implementation
Using the weak symbol explicit_bzero_hook does not work if LTO is
enabled. Instead avoid memset optimizations using an asm memory
barrier.

Use a fallback implementation where the memory is zeroed through
volatile.
2017-12-16 23:07:48 +01:00
Markus Staab
5142a06506 Use known string "file" in stream layer 2017-12-16 13:25:05 +01:00
Dmitry Stogov
0f06df310c Turn "php_stream_wrapper"s into constants
Keep non-constant "php_stream_wrapper"s in API functions and callbacks for compatibility.
2017-12-14 22:46:22 +03:00
Dmitry Stogov
83e495e0fd Move constants into read-only data segment 2017-12-14 22:14:36 +03:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Dmitry Stogov
76e4c8ba73 typo 2017-12-12 19:01:10 +03:00
Dmitry Stogov
fe4c7898d8 Avoid reallocation and double copying of variable names. 2017-12-12 13:47:47 +03:00
Javier Eguiluz
c136fda18e Fixed a typo 2017-12-09 18:39:06 +01:00
Anatol Belski
98416a37f3 Put missing signature into header 2017-12-09 00:26:18 +01:00
Dmitry Stogov
6a9d2b2190 Cleanup type conversion 2017-12-07 19:24:55 +03:00
krakjoe
71a460ba7e
bump versions 2017-12-05 14:18:48 +01:00
Dmitry Stogov
cc6a41fad1 Use interned strings as variable names 2017-12-01 01:37:48 +03:00
Dmitry Stogov
7cc6f60134 Added "argv" and "argc" as known strings.
Fixed incorrect "argc" update and corresponding phpdbg test.
2017-12-01 01:35:47 +03:00
Dmitry Stogov
af7705bec2 Avoid strings duplication (zend_hash* and printf may work with non zero terminated strings) 2017-11-30 23:29:21 +03:00
Dmitry Stogov
f98721b4e0 Intern auto global name strings in first place 2017-11-29 17:10:51 +03:00
Anatol Belski
a935ad927e Merge branch 'PHP-7.2'
* PHP-7.2:
  Follow up on bug #75574 for FCGI side
2017-11-28 20:35:19 +01:00
Anatol Belski
0b30461764 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Follow up on bug #75574 for FCGI side
2017-11-28 20:34:44 +01:00
Anatol Belski
8b57a5bca0 Follow up on bug #75574 for FCGI side 2017-11-28 20:33:11 +01:00
Nikita Popov
9215be76a6 Fix C++ build failure due to format macros
PRIi64 etc. may not be available without this macro definition, on
pre-C++11 compilers. At least I think that's the issue.
2017-11-24 19:02:59 +01:00
Anatol Belski
e69fa2865f Eliminate cast 2017-11-22 12:50:50 +01:00
krakjoe
f3545165b2
Merge branch 'PHP-7.2'
* PHP-7.2:
  Check for binary_location allocation failure
2017-11-22 04:49:52 +00:00
krakjoe
ae810d785c
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Check for binary_location allocation failure
2017-11-22 04:49:43 +00:00
krakjoe
fee6c812c4
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Check for binary_location allocation failure
2017-11-22 04:49:34 +00:00
Sebastian Ramadan
7e0feb8856
Check for binary_location allocation failure 2017-11-22 04:49:04 +00:00
Sebastian Ramadan
7d5691cd69 Fix some printf() specifier usages
Use PRIu32 when printing uint32_t.
Fix some %u/%d confusions.
Add some casts where types are not standardized.
2017-11-21 22:50:27 +01:00
Anatol Belski
6b54b3409a Ensure shift doesn't overflow, closes #2916 2017-11-21 18:48:37 +01:00
Nikita Popov
26f8fc833b Enable and fix printf() format warnings
Add _unchecked() variants of zend_spprintf and zend_strpprintf for
cases where we specifically want to disable these checks, such as
use of %H.
2017-11-16 21:15:36 +01:00
Anatol Belski
a5bc5aed71 Patch core for PCRE2 support
RFC https://wiki.php.net/rfc/pcre2-migration
2017-11-13 19:37:38 +01:00
Sara Golemon
fd463cfbad Merge branch 'PHP-7.2'
* PHP-7.2:
  Bugfix#75515 php://streams behaving greedily
2017-11-13 13:35:46 -05:00
Sara Golemon
0a45e8f096
Bugfix#75515 php://streams behaving greedily
5060fc23 attempted to fix #68948 by treating all non-uri streams
as non-blocking, however php://fd/* streams (which includes stdin)
may block if the other end of the IPC isn't finished.

This represents a partial revert to the pre RC6 state,
but includes an escape hatch for php://memory and php://temp
streams which are local to the current process.

This also restores stream_set_chunk_size test to previous state.
2017-11-13 09:40:34 -05:00
Remi Collet
704bcd385f next version is 7.2.1 2017-11-13 12:46:30 +01:00
Joe Watkins
3be6810385
bump versions 2017-11-07 15:35:14 +00:00
Anatol Belski
bc7d4dc523 7.0.27 next 2017-11-07 10:07:52 +01:00
Sara Golemon
e36244e776 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixes #68948 related to a BC break introduced by #68532 fix.
2017-11-06 17:41:09 -05:00
Simon JAILLET
5060fc2349 Fixes #68948 related to a BC break introduced by #68532 fix. 2017-11-06 17:34:42 -05:00
Dmitry Stogov
95b33f2394 Added RC_DEBUG exception 2017-11-03 00:34:18 +03:00
Dmitry Stogov
d92a701a3b Added RC_DEBUG exception 2017-11-02 23:54:24 +03:00
Dmitry Stogov
3e35def20b Start RC_DEBUG at the end of MINIT and finish in MSHUTDOWN after all worker threads are terminated. 2017-11-02 23:52:50 +03:00
Dmitry Stogov
f2b91b31e4 Switch back from "request" interned strings storage to "permanent" in MSHUTDOWN 2017-11-02 23:29:21 +03:00
Dmitry Stogov
87a72e7e62 Use interned strins for output handler aliases and conflict checkers names. 2017-11-02 14:11:56 +03:00
Dmitry Stogov
468fd78bff Fixed memory leaks 2017-11-02 03:04:27 +03:00
Dmitry Stogov
67d5f39a47 Persistent resources are "thread-local".
Register persistent resources through new functions zend_register_persistent_resource()/zend_register_persistent_resource_ex().
2017-11-01 15:19:31 +03:00
Xinchen Hui
a8a17a72b0 RC manipulation cleanup 2017-11-01 10:25:10 +08:00
Dmitry Stogov
8897c80956 Use interned strings for stream transports 2017-11-01 02:39:09 +03:00
Dmitry Stogov
bbfd0df9d3 Use interned strings for persistent stream wrappers and filters 2017-10-31 18:51:35 +03:00
Dmitry Stogov
974a8f8ad2 Use internet strings for EG(ini_entries) 2017-10-31 02:16:46 +03:00
Dmitry Stogov
8203a0668d Merge branch 'master' into rc_debug
* master:
  Use per-request heap instead of system one
  Extend zend_register_class_alias_ex() with additional argument to allow creating persistent or per-request aliases
  Makrk persistent resources and references with GC_PERSISTENT flag
2017-10-27 14:59:09 +03:00
Dmitry Stogov
cf67a421e9 Use per-request heap instead of system one 2017-10-27 14:45:54 +03:00
Dmitry Stogov
49ea143bbd Encapsulate reference-counting primitives.
Prohibit direct update of GC_REFCOUNT(), GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF() shoukf be instead.
Added mactros to validate reference-counting (disabled for now).
These macros are going to be used to eliminate race-condintions during reference-counting on data shared between threads.
2017-10-27 01:28:58 +03:00
Joe Watkins
5d2456c278
Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix issue with zend signals in php_request_startup
2017-10-19 11:48:37 +01:00
Joe Watkins
0397b8c5c5
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix issue with zend signals in php_request_startup
2017-10-19 11:48:27 +01:00
Herman J. Radtke III
bb1814b5c3
Fix issue with zend signals in php_request_startup
The zend_signals_activate() function is called in php_request_startup()
even if `--disable-zend-signals` is used. This causes uninitialized
variables to be used on ZTS builds.

This was removed in 7.1 in c870633. Removing guards from the SAPIs
should be fine, but removing the guard from main/main.c prevents anyone
using the static embedded library to integrate PHP into their programs.

For more details, see the "Additional remark" section in
https://bugs.php.net/bug.php?id=74149
2017-10-19 11:48:16 +01:00
Dmitry Stogov
b4903aef16 Move a part of opcache initialization into post_startup phase (when all extensions already loaded). 2017-10-18 17:18:54 +03:00
Joe Watkins
c2bfdf3712
bump version 2017-10-10 16:12:36 +01:00
Anatol Belski
51658bac35 Move dev to 7.0.26 2017-10-10 08:26:04 +02:00
Peter Kokot
4fcecfb291 Remove old apache_hooks occurrence
The apache_hooks SAPI has been removed since PHP >= 7.0 and there is no
need to have two different php_request_startup definitions.

Also php_request_startup_for_hook() and php_request_shutdown_for_hook() functions
are not used in the PHP source code directly anymore. They are out of sync and
are not touched when making changes to the shutdown sequence.

The php_start_sapi() function was therefore not used anymore and is
removed.
2017-10-08 17:49:24 +02:00
Nikita Popov
18e297d3dd Merge branch 'PHP-7.2' 2017-09-24 08:55:28 +02:00
Nikita Popov
76b2b4a190 Merge branch 'PHP-7.1' into PHP-7.2 2017-09-24 08:55:12 +02:00
Nikita Popov
628c257f71 Merge branch 'PHP-7.0' into PHP-7.1 2017-09-24 08:54:36 +02:00
Nikita Popov
73d6456d7d Fixed bug #75252 2017-09-24 08:53:27 +02:00
Anatol Belski
a9273a7dfe Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix thread safety
2017-09-21 10:33:35 +02:00
Anatol Belski
95870dcc77 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix thread safety
2017-09-21 10:33:13 +02:00
Anatol Belski
96323d1bd7 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix thread safety
2017-09-21 10:32:47 +02:00
Anatol Belski
da2f581833 Fix thread safety 2017-09-21 10:32:09 +02:00
Andrea Faulds
471d2bb0ae Merge branch 'PHP-7.2' 2017-09-21 00:05:55 +01:00
Andrea Faulds
7418f6814f Merge branch 'PHP-7.1' into PHP-7.2 2017-09-21 00:04:56 +01:00
Andrea Faulds
b71023e297 Merge branch 'PHP-7.0' into PHP-7.1 2017-09-21 00:04:08 +01:00
Andrea Faulds
418f97443a Fix bug #75236 2017-09-21 00:02:52 +01:00
Dmitry Stogov
dc5d850478 Merge branch 'PHP-7.2'
* PHP-7.2:
  Use private names for new libpcre symbols.
2017-09-18 20:01:51 +03:00
Dmitry Stogov
5ef10d08ec Use private names for new libpcre symbols. 2017-09-18 20:00:45 +03:00
Joe Watkins
7f01872a24
bump versions 2017-09-12 15:34:30 +01:00
Anatol Belski
5cf215536b Move dev to 7.0.25 2017-09-12 09:02:01 +02:00
Kalle Sommer Nielsen
d3bc8beb4f Removed support for BeOS, development for BeOS was supported 17 years ago.
This patch however does not drop support for the BeOS compatible variant, Haiku, see Github PR #2697 which is currently a WiP

I intentionally left out some fragments for BeOS in the build system for that seems to be bundles
2017-08-29 22:03:56 +02:00
Nikita Popov
91188a8262 Merge branch 'PHP-7.2' 2017-08-25 22:12:55 +02:00
David Carlier
24c0a17d78 Sync strlcat() implementation
Sync with last version made few days after.
2017-08-25 22:12:23 +02:00
Anatol Belski
dda70e0106 Follow up on ed9c16ad5def47d1c8ae2787f53dccfac893ce5f
The event log is not line based, passing the message as is here is just
fine. Otherwise we'd create multiple event log items with partial
messages.
2017-08-19 13:51:44 +02:00
Philip Prindeville
a1f3a0105d Turn php_syslog() into wrapper for syslog and split lines 2017-08-19 13:51:44 +02:00
Joe Watkins
5b02d10584
bump versions 2017-08-16 16:41:15 +01:00
Anatol Belski
3af6201224 move dev to 7.0.24 2017-08-15 09:33:30 +02:00
Anatol Belski
beb9295790 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #75063
2017-08-14 00:53:33 +02:00
Anatol Belski
0a2a136111 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75063
2017-08-14 00:51:47 +02:00
Anatol Belski
3069ad8dd1 Fixed bug #75063 2017-08-14 00:44:19 +02:00
Andrea Faulds
29606732af Merge branch 'PHP-7.2' 2017-08-12 01:39:27 +01:00
Andrea Faulds
f877b86604 Merge branch 'PHP-7.1' into PHP-7.2 2017-08-12 01:38:46 +01:00
Andrea Faulds
e88ab74886 Merge branch 'PHP-7.0' into PHP-7.1 2017-08-12 01:37:47 +01:00
Andrea Faulds
b59718bdc4 Fix bug #74725 (html_errors=1 breaks unhandled exceptions) 2017-08-12 01:37:20 +01:00
Adam Saponara
db96b7c245
Fix #75031: Support append mode in php://temp streams
This patch introduces a distinction between write mode and append
mode in `php://temp` and `php://memory` streams, achieving parity
with C stdio.
2017-08-04 12:43:49 +01:00
Anatol Belski
095d763f99 remove cast 2017-07-28 15:09:38 +02:00
Anatol Belski
7b34fae703 adjust signature and remove casts 2017-07-28 15:07:09 +02:00
Anatol Belski
0d1eeeb68d move zend_ato*() to size_t and remove casts 2017-07-28 14:59:31 +02:00
Anatol Belski
44bbae99f8 remove cast 2017-07-28 14:59:31 +02:00
Anatol Belski
49d9b3013f Move cwd_state and path related routines to size_t
Having `int` there is no real profit in the size or speed, while unsigned
improves security and overall integration. ZPP supplied strings can
be then accepted directly and structs can be still handled with smaller
unsigned types for size reasons, which is safe. Yet some related places
are to go.

basic move tsrm_realpath_r to size_t

fix conditions and sync with affected places

touch ocurrences of php_sys_readlink usage

follow up on phar path handling

remove duplicated check

move zend_resolve_path and related pieces to size_t

touch yet resolve path related places

remove cast

missing pieces

missing piece

yet cleanups for php_sys_readlink for ssize_t

fix wrong return
2017-07-27 20:11:21 +02:00
Anatol Belski
7a8c047c23 Merge branch 'PHP-7.2'
* PHP-7.2:
  remove casts and ensure no out of bounds access
  sodium ext: delete copypasta from sodium_crypto_kdf_derive_from_key()
2017-07-21 22:27:34 +02:00
Anatol Belski
7ec8b8d49f remove casts and ensure no out of bounds access 2017-07-21 22:26:37 +02:00
Sara Golemon
60e62b46fa Merge branch 'PHP-7.2'
* PHP-7.2:
  Do not allow using traits/interfaces/abstract classes as stream wrappers
2017-07-19 14:01:56 -04:00
Sara Golemon
bb02f99e71 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Do not allow using traits/interfaces/abstract classes as stream wrappers
  Add oci8_failover.c to config.w32, follow up for commit 1b797f7a
2017-07-19 14:01:18 -04:00
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
235d523ebd Merge branch 'PHP-7.2'
* PHP-7.2:
  Keep resource of enclosing stream, because it may be referenced from other place(s). This fixes valgrind warnings on Zend/tests/type_declarations/scalar_basic.phpt
2017-07-19 17:18:41 +03:00
Dmitry Stogov
6fcc7134f1 Keep resource of enclosing stream, because it may be referenced from other place(s).
This fixes valgrind warnings on Zend/tests/type_declarations/scalar_basic.phpt
2017-07-19 17:16:56 +03:00
Dmitry Stogov
495ae99f33 Merge branch 'PHP-7.2'
* PHP-7.2:
  Reset globals on startup or restart
2017-07-19 15:36:58 +03:00
Dmitry Stogov
95a1f77b5e Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Reset globals on startup or restart
2017-07-19 15:36:48 +03: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
Kalle Sommer Nielsen
a398df3e36 Removed Bird(broken)step support from ODBC 2017-07-19 10:19:32 +02:00
Kalle Sommer Nielsen
bfdd22a3de Remove old references to SAPIs and extensions no longer in the core 2017-07-19 09:09:24 +02:00
Joe Watkins
f4323248ec
bump versions 2017-07-18 17:21:19 +01:00
Sara Golemon
5230541ef5
Prepare for PHP 7.3 2017-07-18 10:45:47 -04:00
Sara Golemon
05ff0c5180
Bump all API numbers in prep for 7.2 fork 2017-07-18 10:45:02 -04:00
Anatol Belski
649027b963 move to 7.0.23 for dev 2017-07-18 10:25:40 +02:00
Sara Golemon
3de82a0349
Provide zend_string wrappers for php_base64_(en|de)code
Also pull existing php_base64_decode() proxy out to an inline.
Bump PHP_API_VERSION for ABI change.
2017-07-16 17:01:20 -04:00
Francois Laupretre
0782a7fc63 Fixed bug #74866 extension_dir = "./ext" now use current directory for base 2017-07-13 14:27:19 +02:00
Anatol Belski
2283b6ff53 eliminate casts 2017-07-10 15:48:54 +02:00
Anatol Belski
72b0a3a892 remove some casts 2017-07-09 15:47:01 +02:00
Anatol Belski
84079f4a1e cleanup casts 2017-07-09 15:31:05 +02:00
Anatol Belski
e403acc74b remove useless cast 2017-07-09 15:15:17 +02:00
Anatol Belski
aaf09f7bdf eliminate casts 2017-07-09 15:11:02 +02:00
Anatol Belski
384f0f8a4c sync vim mode lines in main 2017-07-09 15:07:23 +02:00
Anatol Belski
9ad0d0ca3c replace the stack var by a macro 2017-07-06 20:47:04 +02:00
Anatol Belski
e08c0ed8ce Bug #74815 crash with a combination of INI entries at startup
TS related VCWD routines depend on CWD. Thus, a premature CWD
deactivation renders the VCWD layer unusable. Same issue seems to
persist in versions < 7.2, just that the code path is actually unused so
the issue didn't show up. Still might make sense to backport this into
lower branches.
2017-06-27 16:30:10 +02:00
Dmitry Stogov
caaeb4849a Removed EG(valid_symbol_table). Used EG(active) instead. 2017-06-26 13:35:07 +03:00
Tom Van Looy
04fb3f28ff Remove superfluous semicolons 2017-06-26 00:23:25 +02:00
Nikita Popov
205807f60e Move va_copy compatibility code into zend_portability.h
Previously this was defined in zend.c and php.h and also handled
in another way in soap.c.
2017-06-25 17:00:26 +02:00
Dmitry Stogov
d55b43d9cb Merge branch 'fast_shutdown'
* fast_shutdown:
  Reseet EG(active) a bit early.
  Reuse "nIndex"
  shutdown_executor() refactoring (reuse opcache fast request shutdown code)
2017-06-23 14:59:29 +03:00
Sara Golemon
d09edf7b34 Minor refactor of load extension by name impl
Minimize the #ifdef surface area
Localize orig_libpath to retry scope
Send errors to php_error() rathern than stderr
2017-06-22 13:13:45 -04:00
Francois Laupretre
fe5c8f2b80 Allow loading PHP and Zend extensions by name
Allow extension name as INI 'extension=' and dl() argument
No BC break, as file name is still accepted.
When using the '-z' command line option (CLI/CGI), an absolute file name must still be provided (nothing changed here)
Change comments in example INI files
2017-06-22 12:58:15 -04:00
Dmitry Stogov
f25ecdacf8 shutdown_executor() refactoring (reuse opcache fast request shutdown code) 2017-06-22 01:45:28 +03:00
Dmitry Stogov
7af5741333 Avoid useless duplication 2017-06-21 12:57:24 +03:00
Dmitry Stogov
687123ebf2 Use request heap. 2017-06-21 11:25:05 +03: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
Anatol Belski
fb6e718764 fix ticks init in ts build 2017-06-15 23:48:03 +02:00
Kalle Sommer Nielsen
a251d9b2c1 Change PHP_OS_FAMILY to "Darwin" instead of "Mac" for Darwin based systems (as suggested by Davey) 2017-06-14 03:29:06 +02:00
Sebastian Bergmann
362d2e42a0 Use "Mac" instead of "OSX" to identify macOS in PHP_OS_FAMILY 2017-06-13 15:45:57 +02:00
Xinchen Hui
e33bc38e83 Merge branch 'PHP-7.1'
* PHP-7.1:
  Add simple cli test for PATH/HOST ini sections
  Fixed bug #74600
2017-06-12 17:21:45 +08: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
Niklas Keller
bec91e1117 Use any TLS crypto method by default, don't use SSL 2017-06-10 17:31:24 -04: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
e60cedfbc3 Merge branch 'PHP-7.1'
* PHP-7.1:
  Bugfix #74556 stream_socket_get_name() returns empty string
  Fix abstract name handling to be binary safe
2017-05-28 08:51:41 -07: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
Dmitry Stogov
a08723d3d3 Use interned empty and "one char" strings. 2017-05-18 17:59:59 +03:00
Xinchen Hui
a33aca545c Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #74600 (crash (SIGSEGV) in _zend_hash_add_or_update_i)
2017-05-16 19:33:24 +08: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
2bce80150f Merge branch 'PHP-7.1' 2017-04-30 20:28:38 +01: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
2111de0dd7 Merge branch 'PHP-7.1'
* PHP-7.1:
  Revert "Detect invalid port in xp_socket parse ip address"
  Revert "Follow up patch regarding bug #74216, see bug #74429"
2017-04-27 11:13:00 +02: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
bbf0a9d8a7 Merge branch 'PHP-7.1'
* PHP-7.1:
  Follow up patch regarding bug #74216, see bug #74429
2017-04-25 13:00:10 +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
bbe2a13395 Merge branch 'PHP-7.1'
* PHP-7.1:
  #74337 pointer returned by php_stream_fopen_tmpfile not validated in memory.c
2017-04-22 21:59:07 +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
010ccadf44
Merge branch 'PHP-7.1'
* PHP-7.1:
  Update php_network.h
2017-04-20 06:39:37 +01: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
696bd37e67 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed condition check
  Fixed condition check
  another place

Conflicts:
	ext/mcrypt/mcrypt.c
2017-04-10 14:49:13 +08: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
4e9f0a80b9 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed issue #2466 Invalid integer constant expression error in php.h
2017-04-10 14:41:59 +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
Thomas Punt
9f08aff3fd Remove superfluous allocation checks around ZMM-based functions 2017-04-02 00:58:19 +02: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
Anatol Belski
65afcf81a0 use extra flag to turn on php implementations 2017-03-19 23:19:31 +01:00
Anatol Belski
5d5679c4a9 define corresponding config macros, as we already trick symbols 2017-03-19 23:11:19 +01:00
Thomas Punt
932c4b35dc Remove more unnecessary checks on Zend's allocator functions 2017-03-16 12:23:55 +01:00
Bob Weinand
b6524f83e2 Merge branch 'PHP-7.1' 2017-03-14 22:17:23 +01: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
2ba2b768cc Merge branch 'PHP-7.1'
* PHP-7.1:
  Detect invalid port in xp_socket parse ip address
2017-03-07 12:11:31 -08: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
Anatol Belski
c698299550 Interned strings unification for TS/NTS
Hereby, interned strings are supported in thread safe PHP. The patch
implements two types of interned strings

- interning per process, strings are not freed till process end
- interning per request, strings are freed at request end

There is no runtime interning.

With Opcache, all the permanent iterned strings are copied into SHM on
startup, additional copying into SHM might happen on demand.
2017-03-04 10:39:13 +01: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
1686d302e1 Merge branch 'PHP-7.1' 2017-02-25 12:58:03 +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
Kalle Sommer Nielsen
db982bbaa1 Fix PHP_OS_FAMILY for Linux (Joe) 2017-02-22 22:13:33 +01:00
Kalle Sommer Nielsen
f9959ee7c2 Change PHP_OS_FAMILY slightly
* PHP_OS_FAMILY is now a macro, to allow extensions to take advantage of it, it is defined in php.h
* Values are not upper-case-first, not always uppercase. Windows is no longer just "Win", if we want the short version for testing then PHP_OS is always WINNT anyway
2017-02-22 12:31:06 +01:00
Anatol Belski
e7b4ee3165 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #74090 stream_get_contents maxlength>-1 returns empty string
2017-02-15 14:51:38 +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
Anatol Belski
d53d0a5dc4 refactor php_win32_get_random_bytes(), take 2
As in previous variant, locking is removed and the initialization
is done only once at process start. The CNG API turns out to be
faster, also the initialization is less resources hungry. The
initialization part could need to be improved, if too much startup
failures are sighted in the real world usage. Though that would mean
having locking back.

The usage of CNG was already pointed out and requested in several
reports, with the further refactoring it appears to make sense and
simplify things a backward compatible way.
2017-02-12 17:47:14 +01:00
Xinchen Hui
377bff250d Merge branch 'PHP-7.1'
* PHP-7.1:
  Update NEWS
  Fixed #73496 (Invalid memory access in zend_inline_hash_func)
2017-02-12 18:56:49 +08: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