1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Commit Graph

119364 Commits

Author SHA1 Message Date
Dmitry Stogov ca159561db Fixed IS_UNDEF handling 2020-07-03 10:52:03 +03:00
Christoph M. Becker 807d6c0418 Merge branch 'PHP-7.4'
* PHP-7.4:
  Skip test if SeCreateSymbolicLinkPrivilege is not given
2020-07-03 09:10:37 +02:00
Christoph M. Becker 1b961c0c42 Skip test if SeCreateSymbolicLinkPrivilege is not given 2020-07-03 09:08:59 +02:00
Dmitry Stogov eee9a05015 Fixed IS_INDIRECT handling 2020-07-03 00:14:09 +03:00
Dmitry Stogov fe1052b177 Better instruction selection 2020-07-02 23:41:15 +03:00
Christoph M. Becker e2be50001b Merge branch 'PHP-7.4'
* PHP-7.4:
  Enable readlink_realpath_* tests on Windows
2020-07-02 18:31:43 +02:00
Christoph M. Becker 6f0b73345a Enable readlink_realpath_* tests on Windows
We modify _basic1.phpt so it runs on Windows as well.  The other test
cases hit the issue that `readlink()` fails normally for regular files,
but succeeds on Windows[1].  Therefore, we split these tests, but still
fix the skip reasons.

[1] <http://svn.php.net/viewvc?view=revision&revision=350097>
2020-07-02 18:24:42 +02:00
Nikita Popov 16cb88f31a Fix func info for get_class_methods() 2020-07-02 17:23:57 +02:00
Dmitry Stogov f1536ebbb2 JMP optimization 2020-07-02 17:42:15 +03:00
Christoph M. Becker 1f12d9da5c Merge branch 'PHP-7.4'
* PHP-7.4:
  Enable most lstat_stat_* tests on Windows
2020-07-02 15:36:43 +02:00
Christoph M. Becker 1973ca21bd Enable most lstat_stat_* tests on Windows
Most of these have been skipped on Windows for no good reason (`lstat`
is available there as of PHP 4).  Several others would only fail,
because the `blksize` and `blocks` elements are always `-1` on Windows,
which can easily be fixed by using `%i` format specifiers instead of
`%d`.
2020-07-02 15:36:07 +02:00
Christoph M. Becker 1eefa09e90 [ci skip] Merge branch 'PHP-7.4'
* PHP-7.4:
  Update php_version.h
2020-07-02 15:33:35 +02:00
Christoph M. Becker 2ecb4680ad Update php_version.h
That has apparently been overlooked.
2020-07-02 15:30:13 +02:00
Nikita Popov 6a195cacf3 Treat attribute argument lists like normal argument lists
Allow trailing comma. Syntactically allow unpacking, but forbid it
during compilation.

The trailing comma test-case is adopted from GH-5796.
2020-07-02 15:27:45 +02:00
Máté Kocsis d8dfb21b51 Add support for forcing regeneration of arginfo files
Closes GH-5795
2020-07-02 14:54:52 +02:00
Dmitry Stogov fe9b5ce322 Load constant value only if necessary 2020-07-02 14:43:17 +03:00
Christoph M. Becker 66a5f9fb18 Merge branch 'PHP-7.4'
* PHP-7.4:
  Extract test helper function for SeCreateSymbolicLinkPrivilege check
2020-07-02 12:24:49 +02:00
Christoph M. Becker c49fb83c38 Extract test helper function for SeCreateSymbolicLinkPrivilege check 2020-07-02 12:23:49 +02:00
Christoph M. Becker 8c67c16699 Update to PCRE2 10.35
We also port a fix for the build system regarding the `-fcf-protection`
gcc flag; cf. <https://bugs.exim.org/show_bug.cgi?id=2578>.
2020-07-02 12:15:04 +02:00
Nikita Popov 9b41f22fb2 Remove leftover debug comment 2020-07-02 11:51:51 +02:00
Nikita Popov b0dc325bba Merge branch 'PHP-7.4'
* PHP-7.4:
  Handle SO_ options only at SOL_SOCKET level
  Allow different error message for errno 58
2020-07-02 11:44:34 +02:00
Dmitry Stogov 2068f019e3 Eliminate useless exception checks 2020-07-02 12:42:09 +03:00
Nikita Popov f1bf058d7c Handle SO_ options only at SOL_SOCKET level
These options may have the same value as options at other levels.

This issue showed up on ppc64el.
2020-07-02 11:41:08 +02:00
codinghuang 5ea28fe6c4 Use correct ZPP mechanism in get_class_methods()
From now on, instead of returning null, an exception is thrown when
not a string or an object is passed to the function.

Closes GH-5792
2020-07-02 11:40:05 +02:00
Nikita Popov 0a216f5edb Allow different error message for errno 58
Apparently this is EDEADLOCK on some systems.
2020-07-02 11:39:22 +02:00
Nikita Popov 4500309f10 Skip enchant test under asan
There is a known memory leak here:
https://bugs.launchpad.net/ubuntu/+source/enchant/+bug/305468
2020-07-02 11:37:09 +02:00
Nikita Popov 1ed5a63c86 Check that "tokenizer" extension is available in gen_stub.php 2020-07-02 10:37:14 +02:00
Nikita Popov 271bc689ea Add iterator get_gc function for generators
Closes GH-5787.
2020-07-01 15:17:26 +02:00
Nikita Popov 312201dce4 Add get_gc handle for object iterators
Optional handler with the same semantics as the object handler.
2020-07-01 15:17:22 +02:00
Christoph M. Becker 8d9637bdac [ci skip] (Hopefully) clarify meaning 2020-07-01 12:04:54 +02:00
Christoph M. Becker 942f341b4e Document zend_hash_sort and zend_ts_hash_sort signature change
Cf. <https://github.com/php/php-src/pull/3936>.
2020-07-01 10:11:58 +02:00
Paweł Tomulik 915abeb699 Add ldap_count_references()
Closes GH-5784
2020-07-01 09:29:46 +02:00
Fabien Villepinte 3190282f09 Fix typos in comments 2020-07-01 09:08:28 +02:00
Christoph M. Becker 3516a9c8f0 Replace ISO_8859-* with ISO8859-* aliases for MBString
We also remove the mbregex ISO 8859 aliases with underscores.
2020-06-30 18:43:40 +02:00
Nikita Popov 89b2483edd Remove generator iterator member
This is probably a leftover from the PHP 5 implementation, where
the iterator was embedded directly in the generator.
2020-06-30 18:26:29 +02:00
Nikita Popov e2a407c2fe Revert "Update to PCRE2 10.35"
This reverts commit b419f96c62.

This breaks the GCC build with -fcf-protection (default on Ubuntu
at least).
2020-06-30 18:24:48 +02:00
Nikita Popov af4ff75c98 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove bogus generator iterator dtor
2020-06-30 17:33:51 +02:00
Nikita Popov d1be10dd7e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Remove bogus generator iterator dtor
2020-06-30 17:33:33 +02:00
Nikita Popov 187a72d563 Remove bogus generator iterator dtor
Fixes a use-after-free encountered in Symfony's SecurityBundle.
I don't have a reproducer for this, and believe the issue can only
occur if we leak an iterator (the leak is a separate issue).

We should not free the generator iterator here, because we do not
own it. The code that fetched the iterator is responsible for
releasing it. In the rare case where we do hit this code-path,
we cause a use-after-free.
2020-06-30 17:32:42 +02:00
Christoph M. Becker b419f96c62 Update to PCRE2 10.35 2020-06-30 16:19:02 +02:00
Paweł Tomulik b3698ed9eb Promote warning to exception in ldap_set_rebind_proc()
From now on, ldap_set_rebind_proc() will only accept callable or null
as argument 2.

Closes GH-5763
2020-06-30 16:08:34 +02:00
Máté Kocsis 30067894fc Update outdated arginfo hashes 2020-06-30 16:02:11 +02:00
Nikita Popov 917e28d77e Assume offsetof() exists
This is a standard C macro. Define XtOffsetOf as an alias for
compatibility, as this is the name we use in most code right now.
2020-06-30 15:55:50 +02:00
Nikita Popov 6838ebb1a8 Remove unnecessary ieeefp.h include
This was needed when php_config.h also declare compatibility
shims for isinf() and friends. These are no longer present in
master, so drop this include.
2020-06-30 15:54:47 +02:00
Nikita Popov 41d9423988 Add upgrading note for apache module name
[ci skip]
2020-06-30 15:53:55 +02:00
Nikita Popov b0b836175c Extract some common fuzzer code 2020-06-30 15:05:02 +02:00
Eddie Kohler 75ada661b9 Add unserializehash fuzzer.
Unlike the straight unserialize fuzzer, this runs only on HashContexts,
and it does an update and finalize on the contexts it creates.

Co-authored-by: Nikita Popov <nikic@php.net>
2020-06-30 14:30:33 +02:00
Eddie Kohler ada776c84c Make HashContexts serializable.
* Modify php_hash_ops to contain the algorithm name and
  serialize and unserialize methods.

* Implement __serialize and __unserialize magic methods on
  HashContext.

Note that serialized HashContexts are not necessarily portable
between PHP versions or from architecture to architecture.
(Most are, though Keccak and slow SHA3s are not.)

An exception is thrown when an unsupported serialization is
attempted.

Because of security concerns, HASH_HMAC contexts are not
currently serializable; attempting to serialize one throws
an exception.

Serialization exposes the state of HashContext memory, so ensure
that memory is zeroed before use by allocating it with a new
php_hash_alloc_context function. Performance impact is
negligible.

Some hash internal states have logical pointers into a buffer,
or sponge, that absorbs input provided in bytes rather than
chunks. The unserialize functions for these hash functions
must validate that the logical pointers are all within bounds,
lest future hash operations cause out-of-bounds memory accesses.

* Adler32, CRC32, FNV, joaat: simple state, no buffer positions
* Gost, MD2, SHA3, Snefru, Tiger, Whirlpool: buffer positions
  must be validated
* MD4, MD5, SHA1, SHA2, haval, ripemd: buffer positions encoded
  bitwise, forced to within bounds on use; no need to validate
2020-06-30 14:30:33 +02:00
Eddie Kohler dc85be5456 Mark Keccak functions that contain expected misaligned accesses.
To avoid undefined behavior warnings for those accesses.
2020-06-30 14:26:48 +02:00
Eddie Kohler ff69a8a789 Move __alignof__ support check into main configure.ac. 2020-06-30 14:26:48 +02:00