Commit Graph

122540 Commits

Author SHA1 Message Date
Nikita Popov
0067c3ced1 Fix lexing of zero octal followed by whitespace
We'd call strtol starting at the whitespace, and strtol strips
whitespace...

Fixes oss-fuzz #29272.
2021-01-05 12:25:19 +01:00
Nikita Popov
ed4f18b463 Merge branch 'PHP-8.0'
* PHP-8.0:
  gdbinit: use ____print_str to print htable keys
2021-01-05 10:13:21 +01:00
Nikita Popov
5e57f37247 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  gdbinit: use ____print_str to print htable keys
2021-01-05 10:12:43 +01:00
Dylan K. Taylor
6b631f073d gdbinit: use ____print_str to print htable keys
I noticed this problem while dumping the contents of EG(function_table),
where keys for closures start with a null byte. printf interprets this
as a zero-length string and emits nothing. This allows the key to be
rendered properly in readable form.

Closes GH-6577.
2021-01-05 10:11:56 +01:00
George Peter Banyard
589bdf30b2 Implement Explicit octal notation for integers RFC
RFC: https://wiki.php.net/rfc/explicit_octal_notation

Add an extensive test suits for other variants of integer literals

Closes GH-6360
2021-01-04 21:09:23 +01:00
Nikita Popov
ab9f497b90 Fix curl_getinfo() funcinfo
This can now return any type with any refcount.
2021-01-04 18:57:57 +01:00
Christoph M. Becker
7d30943dc9 Merge branch 'PHP-8.0'
* PHP-8.0:
  [ci skip] Add forgotten NEWS entry (bug 80560)
2021-01-04 18:20:00 +01:00
Christoph M. Becker
121790eaff [ci skip] Add forgotten NEWS entry (bug 80560) 2021-01-04 18:19:45 +01:00
George Peter Banyard
af1b89f36c Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix bug #80584: 0x and 0X are considered valid hex numbers by filter_var()
2021-01-04 18:08:04 +01:00
George Peter Banyard
764b7bf108 Fix bug #80584: 0x and 0X are considered valid hex numbers by filter_var()
Closes GH-6573
2021-01-04 18:07:47 +01:00
Christoph M. Becker
a8413902b1 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #76929: zip-based phar does not respect phar.require_hash
2021-01-04 17:49:07 +01:00
Christoph M. Becker
9f96b2bdc8 Fix #76929: zip-based phar does not respect phar.require_hash
Based on the patch provided by david at bamsoftware.

Closes GH-6517.
2021-01-04 17:48:45 +01:00
Nikita Popov
5276ca6179 Manually store CURLOPT_PRIVATE data
This is simpler than going through curl, because we can manage
the memory more easily (in particular, this removes the need for
to_free->str). Additionally this allows the CURLOPT_PRIVATE data
to have any type, instead of being implicitly cast to string.
2021-01-04 16:59:57 +01:00
Nikita Popov
5c21d39d55 Remove method member from php_curl_callback
For these callbacks a non-null callback already indicates that
a user callback should be used. We don't need an additional
member to tell us the same thing.
2021-01-04 16:24:20 +01:00
Nikita Popov
ee6cb72dee Remove unused still_running member 2021-01-04 16:24:19 +01:00
Tyson Andre
e622e868c7 Reduce memory usage of SplObjectStorage
Track an 8-byte pointer as the key instead of 16-byte zval.
(4 byte on 32-bit builds)

The memory used for a set of 1 million objects decreased from
114 MiB to 106 MiB.

Use the new `Z_PARAM_*` APIs to parse the `zend_object*` pointer directly

Closes GH-6566
2021-01-04 10:20:44 -05:00
Nikita Popov
ce2e1076d4 Don't allocate php_curl_handlers separately
Always allocated together with php_curl... no point in that.
2021-01-04 15:59:18 +01:00
Nikita Popov
cc11130b38 Don't allocate php_curlm_handlers separately
This is always allocated together with the php_curlm structure,
there's no point in making it a separate allocation.
2021-01-04 15:59:18 +01:00
Tyson Andre
0d99628ac1 Fix edge case serializing __PHP_Incomplete_Class properties.
This was using strcmp instead of zend_string_equals_literal.
As a result, the property count didn't match the number of properties
being serialized if properties started with
"__PHP_Incomplete_Class\0" (unlikely)

(before, `'O:8:"Missing_":1:{}'` would be serialized, which failed to
unserialize)

Everywhere else expects the MAGIC_MEMBER to match exactly,
and this should use zend_string_equals_literal as an example for other code.

This has used strcmp since 2004 in deb84befae

Closes GH-6555
2021-01-04 09:46:54 -05:00
Tyson Andre
a25886d163 Optimize SplFixedArray when magic methods aren't overridden
This decreases the memory usage of SplFixedArrays by 32 bytes per object
on 64-bit systems (use 1 null pointer instead of 5 null pointers)
If allocating a lot of arrays of size 1, memory usage was 19.44MiB before this
change, and 16.24MiB after the change.

Existing tests continue to pass.

Subclassing SplFixedArray is already inefficient and rarely done.
It checks for the existence of 5 methods every time a subclass is instantiated.
(and has to switch back from C to the php vm to call those methods)

Closes GH-6552
2021-01-04 09:44:08 -05:00
Nikita Popov
7eed6c0c05 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix newly added GMP test
2021-01-04 15:27:41 +01:00
Nikita Popov
821eaaf0b4 Fix newly added GMP test 2021-01-04 15:27:20 +01:00
Nikita Popov
66ffa1c9d2 Use single typedef for curl callbacks
There's no value in making these separate types.
2021-01-04 15:19:01 +01:00
Nikita Popov
e69a65a2b5 Export php_getenv() API
This exports a php_getenv() API which will fetch an environment
variable in a thread-safe manner (assuming all other environment
manipulations are thread-safe ... ha ha ha).

Closes GH-6571.
2021-01-04 14:52:07 +01:00
George Peter Banyard
01f7722faa Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix GMP comparison object handler
2021-01-04 14:48:48 +01:00
George Peter Banyard
1b5c62facd Fix GMP comparison object handler
gmp_cmp() doesn't return false anymore in PHP 8 but will throw
an Error if compared to a non numeric string or another type of object.

Closes GH-6553
2021-01-04 14:47:50 +01:00
Nikita Popov
4b544f25ef Merge branch 'PHP-8.0'
* PHP-8.0:
  Try to fix intermittent failures of stream_server_reneg_limit.phpt on macos
2021-01-04 14:33:02 +01:00
Nikita Popov
af7445b9ac Try to fix intermittent failures of stream_server_reneg_limit.phpt on macos
Make sure the server has started up before we try to connect to it.
2021-01-04 14:31:42 +01:00
Nikita Popov
a6eb370d50 Merge branch 'PHP-8.0'
* PHP-8.0:
  Throw ValueError instead of TypeError for malformed GMP number
2021-01-04 14:30:19 +01:00
Nikita Popov
65f14b0d6c Throw ValueError instead of TypeError for malformed GMP number
If the passed argument has correct type (string) but does not
have a well-formed value, throw ValueError instead of TypeError.

Closes GH-6572.
2021-01-04 14:30:08 +01:00
zeriyoshi
53ee3f7f89 Use php_random_bytes() in mt_srand() and uniqid()
Use php_random_bytes() to generate the MT19937 seed if none is
explicitly given. Also use it to generate more_entry for uniqid().

These changes should not impact user-observable behavior apart
from result statistics.

Closes GH-6520.
2021-01-04 14:20:49 +01:00
Dharman
2f1d32d25c Avoid throwing warnings in mysqlnd
Instead report them as proper client errors.

Closes GH-6530.
2021-01-04 12:31:56 +01:00
Christoph M. Becker
9b269df6af Merge branch 'PHP-8.0'
* PHP-8.0:
  SQLite3::query() cannot return null
2021-01-04 12:16:46 +01:00
Christoph M. Becker
abe23bd9a3 SQLite3::query() cannot return null 2021-01-04 12:13:06 +01:00
Nikita Popov
f91ece0d07 Merge branch 'PHP-8.0'
* PHP-8.0:
  Mac M1 crc32 detection support
2021-01-04 11:42:17 +01:00
David CARLIER
6e90c75507 Mac M1 crc32 detection support
Closes GH-6556.
2021-01-04 11:41:52 +01:00
Nikita Popov
faeca51ed3 Merge branch 'PHP-8.0'
* PHP-8.0:
  Disable non-cron travis jobs
2021-01-04 10:55:57 +01:00
Nikita Popov
151fce1129 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Disable non-cron travis jobs
2021-01-04 10:55:50 +01:00
Stanislav Malyshev
9a3ea5ffbc Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix test name
  [ci skip] Update NEWS
  [ci skip] Update NEWS
  [ci skip] Fix order
  [ci skip] Unpdate NEWS
  Fix bug #79405 - gethostbyname() silently truncates after a null byte
  Fix #77423: parse_url() will deliver a wrong host to user
  Fix #77423: parse_url() will deliver a wrong host to user
2021-01-04 01:53:54 -08:00
Stanislav Malyshev
bf2bb39eac Fix test name 2021-01-04 01:52:59 -08:00
Nikita Popov
46d6daea7a Disable non-cron travis jobs
This was already done for PHP-8.0 and master, do it for PHP-7.4
as well.
2021-01-04 10:52:37 +01:00
Stanislav Malyshev
4d1c1e4554 [ci skip] Update NEWS 2021-01-04 01:47:47 -08:00
Stanislav Malyshev
ced4c0bfe6 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  [ci skip] Update NEWS
  [ci skip] Fix order
  [ci skip] Unpdate NEWS
  Fix #77423: parse_url() will deliver a wrong host to user
2021-01-04 01:47:09 -08:00
Stanislav Malyshev
e65932060a [ci skip] Update NEWS 2021-01-04 01:46:32 -08:00
Stanislav Malyshev
ec589a27da Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  [ci skip] Fix order
2021-01-04 01:46:11 -08:00
Nikita Popov
e54499219f Skip tests under asan
When PDO firebird is loaded and these posix tests are run with
parallelism, LeakSanitizer will occasionally segfault. I was not
able to root cause this issue, as I failed to reproduce it in
simpler circumstances. I don't think it's an issue on our side
though.
2021-01-04 10:45:49 +01:00
Stanislav Malyshev
65d7ade684 [ci skip] Fix order 2021-01-04 01:45:15 -08:00
Stanislav Malyshev
2498385dd9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  [ci skip] Unpdate NEWS
2021-01-04 01:44:18 -08:00
Stanislav Malyshev
8967e66559 [ci skip] Unpdate NEWS 2021-01-04 01:43:45 -08:00
Stanislav Malyshev
7daf2d8602 Fix bug #79405 - gethostbyname() silently truncates after a null byte 2021-01-04 01:20:22 -08:00