Commit Graph

113237 Commits

Author SHA1 Message Date
Nikita Popov
0d3da6ac25 Fix segfault when unserializing abstract class 2019-09-16 13:52:52 +02:00
Nikita Popov
b29b846863 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-16 13:03:08 +02:00
Nikita Popov
74876f09c4 Merge branch 'PHP-7.2' into PHP-7.3 2019-09-16 13:02:56 +02:00
Nikita Popov
8873df8e86 Fix leak in SplObjectStorage unserialization
The result of php_var_unserialize always needs to be destroyed,
even if the call failed.
2019-09-16 13:02:32 +02:00
Nikita Popov
c8359fcea2 Fix test after unserialize change 2019-09-16 11:59:43 +02:00
Nikita Popov
4377a8ea41 Sanity-check array/object lengths during unserialization
Avoid OOM conditions in unserialize due to overly large array or
object length specifications.
2019-09-16 11:38:35 +02:00
Dmitry Stogov
6417c507ce Fixed typos 2019-09-16 10:29:29 +03:00
Christoph M. Becker
631dd692a1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Stick with zend_long for ABI compatibility
2019-09-15 15:14:02 +02:00
Christoph M. Becker
da8aa4a798 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Stick with zend_long for ABI compatibility
2019-09-15 15:13:13 +02:00
Christoph M. Becker
81cefab7b0 Stick with zend_long for ABI compatibility
Cf. <https://github.com/php/php-src/pull/4700#issuecomment-531515689>.
2019-09-15 15:11:25 +02:00
Christoph M. Becker
d0247a63b6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78535: auto_detect_line_endings value not parsed as bool
2019-09-14 18:48:28 +02:00
Christoph M. Becker
00ad365125 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78535: auto_detect_line_endings value not parsed as bool
2019-09-14 18:47:12 +02:00
bugreportuser
fdcca93056 Fix #78535: auto_detect_line_endings value not parsed as bool 2019-09-14 18:46:09 +02:00
Nikita Popov
3f76f9416f Fix double-free on invalid large octal with separators
To clean up the mess here a bit, check for invalid octal digits
with an explicit loop instead of mixing this into the string to
number conversion.

Also clean up some type usage.
2019-09-14 12:10:06 +02:00
Nikita Popov
ab4f725d83 Use XtOffsetOf() in url_scanner_ex
Instead of a manual implementation.
2019-09-14 00:25:14 +02:00
Nikita Popov
fa07a9c223 Fix symtable_cache_limit assignment in phpdbg
The meaning of the limit changed in 7.4, it now points one past the
end. Adjust code accordingly.
2019-09-14 00:25:07 +02:00
David Carlier
711bd0a0fc Fix tautological compare warning
The ZEND_ALLOCATOR() macro compares against constants that are
larger than the unsigned short type, resulting in warnings on
clang. Avoid this by explicitly casting to size_t.
2019-09-14 00:25:00 +02:00
Nikita Popov
ee0bf4b24d Define OBJ_PROP_TO_OFFSET() using XtOffsetOf()
This avoids null pointer arithmetic UB.
2019-09-14 00:24:54 +02:00
Nikita Popov
ec30a3b171 Include stddef.h in zend_portability.h for offsetof() macro
This makes sure that we use compiler builtins when they are
available and thus avoid ubsan warnings in clang.

And also reindent the fallback implementation.
2019-09-14 00:24:47 +02:00
Nikita Popov
4226c8247f Fix use-after-free in assign-ref compilation
zend_emit_op_data may reallocate the op_array, so the assignment
of the RETURNS_FUNCTION flag may happen on an outdated opline.

Restructure the code a bit to set the flag before calling
zend_emit_op_data().
2019-09-13 18:22:14 +02:00
Nikita Popov
c25104bb5b Merge branch 'PHP-7.3' into PHP-7.4 2019-09-13 14:37:15 +02:00
Nikita Popov
df982da587 Fix bug #78525
When calling free_result_buffers(), also free field metadata and
restore the mempool state to what it was before any allocations
have been made. Remove the mempool save/restore logic for the
inner result set as this is now handled on a higher level.
2019-09-13 14:37:03 +02:00
Dmitry Stogov
af9b127fed Make constant and copy propagation only for IS_TMP_VAR operands 2019-09-13 12:38:57 +03:00
Dmitry Stogov
e45a757bc2 Fixed incorrect usage of QM_ASSIGN instruction 2019-09-13 12:08:59 +03:00
Dmitry Stogov
51d9f32dbe Fixed bug #78531 (Crash when using undefined variable as object 2019-09-13 01:42:02 +03:00
Dmitry Stogov
5a616191f3 Load string once 2019-09-12 18:46:13 +03:00
Dmitry Stogov
697266a84e Eliminate checks using ZEND_CONST_COND() macro 2019-09-12 18:29:19 +03:00
Nikita Popov
4b9ebd837b Allow throwing exception while loading parent class
This is a fix for symfony/symfony#32995.

The behavior is:

* Throwing exception when loading parent/interface is allowed
  (and we will also throw one if the class is simply not found).
* If this happens, the bucket key for the class is reset, so
  it's possibly to try registering the same class again.
* However, if the class has already been used due to a variance
  obligation, the exception is upgraded to a fatal error, as we
  cannot safely unregister the class stub anymore.
2019-09-12 16:41:18 +02:00
Christoph M. Becker
679cbee870 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix exif build
  NEWS
2019-09-12 09:14:08 +02:00
Christoph M. Becker
31f617d9bc Fix exif build
As of PHP 7.3.0 the `model` field is removed.
2019-09-12 09:13:27 +02:00
Kalle Sommer Nielsen
f6f981c13c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  NEWS
2019-09-12 06:52:24 +03:00
Kalle Sommer Nielsen
716518373f NEWS 2019-09-12 06:50:53 +03:00
Kalle Sommer Nielsen
89227fba99 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78442 ('Illegal component' on exif_read_data since PHP7)
2019-09-12 06:33:40 +03:00
Kalle Sommer Nielsen
6f0e5a45ff Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #78442 ('Illegal component' on exif_read_data since PHP7)
2019-09-12 06:31:52 +03:00
Kalle Sommer Nielsen
2823e938d4 Fixed bug #78442 ('Illegal component' on exif_read_data since PHP7) 2019-09-12 06:21:39 +03:00
Nikita Popov
d88b212ea6 Improve "already declared" error message
If this error is missing because the rtd_key was renamed to lcname,
fetch the class based on lcname and use the class type and cased
name from there.
2019-09-11 17:04:13 +02:00
Nikita Popov
fbe287a677 Fix typo in unlinked_instanceof assertion 2019-09-11 16:50:16 +02:00
Nikita Popov
270e5e3c5b Only allow "nearly linked" classes for parent/interface
The requirements for parent/interface are difference than for the
variance checks in type declarations. The latter can work on fully
unlinked classes, but the former need inheritance to be essentially
finished, only variance checks may still be outstanding.

Adding a new flag for this because we have lots of space, but we
could also represent these "inheritance states" more compactly in
the future.
2019-09-11 16:27:28 +02:00
Nikita Popov
b7c353c8d0 Specify -fsanitize-no-recover
To make it more obvious when there are ubsan failures.
2019-09-11 11:59:33 +02:00
Nicolas Grekas
aee31dd7e4 Improve Symfony test setup
Perform PHPUnit installation under php7.3 -- which will also make
it work on master.

Also properly resolve the tty issue by specifying excluded groups
during the test run.
2019-09-11 11:15:23 +02:00
Nikita Popov
f945c82ec6 Free history_get_history_state() result
It's not documented, but per https://bugs.python.org/issue8065
the result is freshly malloc'd and needs to be freed.
2019-09-11 10:59:04 +02:00
Nikita Popov
1ce830a4aa Fix another pointer indexing UB in http_fopen_wrapper
Only compute the gep after checking whether the pointer is NULL.
2019-09-11 10:31:03 +02:00
Nikita Popov
11f3e24190 Fixed bug #78506 2019-09-11 10:27:32 +02:00
Nikita Popov
0a24cd4e7c Preloading: Fix handling of static vars in inherited methods
Part of bug #78512.
2019-09-11 09:53:10 +02:00
Dmitry Stogov
5f555fb19e Fixed bad format string 2019-09-11 00:52:54 +03:00
Sara Golemon
e9cb68d4f3 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Bump for 7.2.24
2019-09-10 13:05:38 -04:00
Sara Golemon
e2bdd7b4ab Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Bump for 7.2.24
2019-09-10 13:05:17 -04:00
Sara Golemon
a270eb1911 Bump for 7.2.24 2019-09-10 13:04:01 -04:00
Remi Collet
d78ffd54ef Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Raise minimal GCC version, Test with 4.8 is OK With 4.4: error: #pragma GCC diagnostic not allowed inside functions
2019-09-10 16:29:44 +02:00
Remi Collet
664b1a3f57 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Raise minimal GCC version, Test with 4.8 is OK With 4.4: error: #pragma GCC diagnostic not allowed inside functions
2019-09-10 16:29:30 +02:00