Commit Graph

117086 Commits

Author SHA1 Message Date
Christoph M. Becker
b48f2625b5 Fix #79015: undefined-behavior in php_date.c
We check that the given microsecond fraction is in the valid range
[0, 1000000[, and otherwise mark it as invalid.  We also drop the
useless do loop; a plain block is sufficient here.
2020-01-03 14:31:03 +01:00
Christoph M. Becker
54ec44a862 Don't enable sanitizer by default for Windows snapshot builds
Snapshot builds are release builds, and therefore enabling sanitizers
is undesireable.
2020-01-03 14:17:08 +01:00
Máté Kocsis
8f4f1dea34
Convert zend_parse_parameters_none() to fast ZPP
I've done the conversion in those extensions where fast ZPP is predominant.
2020-01-03 13:23:37 +01:00
Máté Kocsis
b7d2882fee
Use zend_parse_parameters_none() instead of zend_parse_parameters_none_throw() 2020-01-03 13:22:39 +01:00
Nikita Popov
f23378d84a Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove unnecessary strncpy in zip
2020-01-03 12:03:31 +01:00
Nikita Popov
3e5675d730 Remove unnecessary strncpy in zip
This causes a warning on GCC 9 and is unnecessary to boot: We
only use "cwd" for the open_basedir check, so we can just as well
pass in the original string.
2020-01-03 11:53:03 +01:00
Nikita Popov
0e6cff70a5 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add test for bug #73816
2020-01-03 11:27:27 +01:00
Nikita Popov
6f63e05320 Add test for bug #73816
This has been fixed by 0f2cdbf214,
add the test case.
2020-01-03 11:26:31 +01:00
Nikita Popov
7ba18b0b39 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #71876
2020-01-03 11:16:25 +01:00
Nikita Popov
3c2fcb717d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #71876
2020-01-03 11:16:14 +01:00
Nikita Popov
1f9e93687c Fixed bug #71876
This is a backport of fcdc0a6db0
to the PHP-7.3 branch. We need to make sure that OnUpdateString
is also called for a NULL value, otherwise the reset of the encoding
at the end of the request will not work.
2020-01-03 11:14:45 +01:00
Nikita Popov
36c8e57495 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79056
2020-01-03 11:09:06 +01:00
Nikita Popov
1dcdcd79ba Fixed bug #79056 2020-01-03 11:08:48 +01:00
Nikita Popov
d8c9902567 Implement WeakMap
RFC: https://wiki.php.net/rfc/weak_maps
2020-01-03 10:43:24 +01:00
Máté Kocsis
763788afea
Use RETURN_THROWS() after zend_throw_exception() in reflection extension 2020-01-03 10:18:34 +01:00
Máté Kocsis
1b93cfee0c
Use RETURN_THROWS() after zend_parse_method_parameters() 2020-01-02 23:01:37 +01:00
Christoph M. Becker
d3b911952b Merge branch 'PHP-7.4'
* PHP-7.4:
  Add test case for bug #78883
2020-01-02 19:28:45 +01:00
Christoph M. Becker
c39b45df72 Add test case for bug #78883
The original test has been provided by divinity76.
2020-01-02 19:28:10 +01:00
Nikita Popov
1f48b15150 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79055
  Extract functions for file cache type serialization
2020-01-02 15:55:01 +01:00
Nikita Popov
8abb2ced39 Fixed bug #79055
Fix file cache serialization of property types. I'm changing the
overall type serialization format to perform additional adjustments
in order to yield a plausible pointer for zend_type, rather than
using an entirely separate serialization format, as was previously
done. That would have been annoying to extend to the case of CE
pointers.
2020-01-02 15:53:15 +01:00
Nikita Popov
48622970fb Extract functions for file cache type serialization
This is already done in master.
2020-01-02 15:16:24 +01:00
Nikita Popov
3bc4159a19 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix file cache run_time_cache unserialization
  Update ZCSG(map_ptr_last) only if for_shm
2020-01-02 15:01:56 +01:00
Nikita Popov
36d5fbbd6b Fix file cache run_time_cache unserialization
If the script was serialized as file_cache_only (thus non-immutable)
and then gets unserialized into SHM, we need to allocate a new
run_time_cache slot and can't use the serialized arena pointer.
2020-01-02 14:56:39 +01:00
Nikita Popov
e576d342bb Update ZCSG(map_ptr_last) only if for_shm
Otherwise we may get a memory protection fault here. Updating of
ZCSG(map_ptr_last) is handled when loading from file cache to SHM.
2020-01-02 11:59:36 +01:00
Nikita Popov
0d35f8e3f2 Merge branch 'PHP-7.4'
* PHP-7.4:
  Populate hashtable of __sleep() properties
  Deref names returned by __sleep()
  Extract php_var_serialize_nested_data() function
2020-01-02 11:14:16 +01:00
Nikita Popov
90fea67546 Populate hashtable of __sleep() properties
Instead of populating a hashtable of property names and then
directly serializing.

This has the advantage of a) detecting duplicate properties more
precisely and b) gives us the ability to discard values without
rewriting the serialization string after the fact for GH-5027.
2020-01-02 11:14:01 +01:00
Nikita Popov
de0ca4734e Deref names returned by __sleep() 2020-01-02 11:14:00 +01:00
Nikita Popov
701e8c66d1 Extract php_var_serialize_nested_data() function
And split code-paths for arrays and objects based on it.
2020-01-02 11:14:00 +01:00
Máté Kocsis
01a50778d1
Use RETURN_THROWS() after zend_throw_exception() in most of the extensions 2020-01-02 10:56:18 +01:00
Nikita Popov
a6486088f8 Switch hash() function to use fastzpp
For short inputs ZPP can be a large fraction of the hash()
execution time.
2020-01-02 10:06:16 +01:00
Nikita Popov
7c787e56b0 Switch php_hash_fetch_ops() to use zend_string
This has two advantages: If the string is already lowercase, we
do not need to copy it, and it will hopefully match the interned
string name of the hash, making the comparison more efficient.
2020-01-02 10:05:12 +01:00
Tyson Andre
a9c04aee67 Always delete tempfile created by ftruncate test.
The ftruncate() test will fill up the disk when the disk has less than
2GB of space left, on some systems.
I think it expands the file to less than 2GB, then returns an error code,
and the file remains at the larger size.

Because the disk is full, the `--CLEAN--` script can't be saved to
`ftruncate_bug76422.clean.php` to be executed, and the cleanup can't be run.
Subsequent tests also fail to run.

Closes GH-5043
2020-01-01 11:20:32 -05:00
Máté Kocsis
349a286461
Use RETURN_THROWS() after zend_throw_error() 2020-01-01 16:42:30 +01:00
Máté Kocsis
9099dbd961
Use RETURN_THROWS() after zend_type_error() 2020-01-01 14:23:21 +01:00
Máté Kocsis
12ce73a5bb
Use RETURN_THROWS() after zend_value_error() 2019-12-31 16:58:15 +01:00
Máté Kocsis
817605917b
Use RETURN_THROWS() during ZPP in the remaining extensions
In reflection, sodium, and SPL
2019-12-31 16:33:02 +01:00
Christoph M. Becker
062744fbdf Merge branch 'PHP-7.4'
* PHP-7.4:
  [ci skip] Revert "Add test case for bug #78883"
2019-12-31 14:27:45 +01:00
Christoph M. Becker
8d2b20db58 [ci skip] Revert "Add test case for bug #78883"
This reverts commit 09e76cbe6d, because
the test fails reliably on AppVeyor.  This needs closer investigation.
2019-12-31 14:27:16 +01:00
Christoph M. Becker
f7eb8141c4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add test case for bug #78883
2019-12-31 13:09:57 +01:00
Christoph M. Becker
09e76cbe6d Add test case for bug #78883
The actual test has been provided by divinity76.
2019-12-31 13:09:27 +01:00
Christoph M. Becker
d694edaee4 Fix erroneous change 2019-12-31 12:24:01 +01:00
Christoph M. Becker
e0b288020b Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove superfluous compiler option
2019-12-31 12:00:48 +01:00
Christoph M. Becker
4f0e5c8dd9 Remove superfluous compiler option
`-fsanitize-address-use-after-scope` is the default as of clang 5.0.0,
and we don't allow to enable ASan for older versions anyway.
2019-12-31 12:00:10 +01:00
Máté Kocsis
345703724c
Use RETURN_THROWS() during ZPP in most of the extensions
Except for some bigger ones: reflection, sodium, spl
2019-12-31 11:46:11 +01:00
Máté Kocsis
d9ac1ca8de
Use ZEND_THROWS() during ZPP in the GD, gettext, GMP, and hash extensions 2019-12-31 00:21:38 +01:00
Máté Kocsis
382a038e05
Use ZEND_THROWS() during ZPP in enchant, exif, fileinfo, filter, and FTP extensions 2019-12-31 00:21:37 +01:00
Máté Kocsis
2f7309b1e9
Use RETURN_THROWS() during ZPP in the date, dba and dom extensions 2019-12-31 00:21:37 +01:00
Máté Kocsis
76c45f35f5
Use RETURN_THROWS() during ZPP in bz2, calendar, com_dotnet extensions 2019-12-31 00:21:37 +01:00
Nikita Popov
3262c28d5c Merge branch 'PHP-7.4'
* PHP-7.4:
  Also propagate include exceptions in opcache
  Make url_stats in resolve_path quiet
2019-12-30 23:22:39 +01:00
Nikita Popov
22e9f9fe4d Also propagate include exceptions in opcache 2019-12-30 23:22:26 +01:00