Commit Graph

117351 Commits

Author SHA1 Message Date
Nikita Popov
981fdd9f51 Merge branch 'PHP-7.4'
* PHP-7.4:
  fix cross compilation failure due to size_t typecast in define
2020-01-30 15:52:22 +01:00
Pascal de Bruijn
f0f5c415a6 fix cross compilation failure due to size_t typecast in define
The following commit introduces a cross-compilation failure:

   93c728b77c
  "Try to control ZEND_MM_ALIGNED_SIZE type"

br-arm-full/build/php-7.4.2/Zend/zend_alloc.h:30:38:
error: missing binary operator before token "8"
                                              ^
br-arm-full/build/php-7.4.2/ext/opcache/ZendAccelerator.c:1380:7:
note: in expansion of macro ‘ZEND_MM_ALIGNMENT’

Closes GH-5128.
2020-01-30 15:51:54 +01:00
Nikita Popov
ca8657a2b5 Initialize SplFixedArray elements to NULL instead of UNDEF
The SplFixedArray API treats all elements as NULL, even if they
have not been explicitly initialized. Rather than initializing
to UNDEF an treating that specially in various circumstances,
directly initialize elements to NULL.

This also fixes an assertion failure in the attached test case.
2020-01-30 15:31:39 +01:00
Nikita Popov
b33697d47e Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79193
2020-01-30 14:56:31 +01:00
Nikita Popov
f70b552326 Fixed bug #79193 2020-01-30 14:55:58 +01:00
Nikita Popov
38e27625ea Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix live range calculation for FE_FETCH
2020-01-30 14:24:28 +01:00
Nikita Popov
be7eab3202 Fix live range calculation for FE_FETCH
Op2 is def here, not a use, so treat it accordingly.
2020-01-30 14:23:46 +01:00
Nikita Popov
a66e226713 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix DatePeriod property handling with indirect modification
2020-01-30 13:14:29 +01:00
Nikita Popov
01d30f880a Fix DatePeriod property handling with indirect modification
We do need to implement get_property_ptr_ptr to make arrays work
correctly.
2020-01-30 13:09:47 +01:00
Christoph M. Becker
2dc5077159 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #70078: XSL callbacks with nodes as parameter leak memory
2020-01-30 13:07:34 +01:00
Christoph M. Becker
dfbeee034a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #70078: XSL callbacks with nodes as parameter leak memory
2020-01-30 13:06:25 +01:00
Christoph M. Becker
8226e704e4 Fix #70078: XSL callbacks with nodes as parameter leak memory
The fix for bug #49634 solved a double-free by copying the node with
`xmlDocCopyNodeList()`, but the copied node is later freed by calling
`xmlFreeNode()` instead of `xmlFreeNodeList()`, thus leaking memory.
However, there is no need to treat the node as node list, i.e. to copy
also the node's siblings; just creating a recursive copy of the node
with `xmlDocCopyNode()` is sufficient, while that also avoids the leak.
2020-01-30 13:04:57 +01:00
Nikita Popov
0078727866 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix leak in DateTimeImmutable::modify()
2020-01-30 12:17:15 +01:00
Nikita Popov
187f359549 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix leak in DateTimeImmutable::modify()
2020-01-30 12:17:10 +01:00
Nikita Popov
494615fcb8 Fix leak in DateTimeImmutable::modify() 2020-01-30 12:16:56 +01:00
Nikita Popov
24a3d0dbd0 Update test for warning -> fatal error change 2020-01-30 12:12:09 +01:00
Nikita Popov
d5dd46fb09 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix copying of functions in variance obligations
2020-01-30 11:56:36 +01:00
Nikita Popov
68596ed71e Fix copying of functions in variance obligations
Only copy sizeof(zend_internal_function) for internal functions.
2020-01-30 11:55:38 +01:00
Nikita Popov
7c34d73876 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add SKIPIF to test requiring mbregex
2020-01-30 11:21:32 +01:00
Nikita Popov
a73f98eda9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add SKIPIF to test requiring mbregex
2020-01-30 11:21:26 +01:00
Nikita Popov
6ccd675776 Add SKIPIF to test requiring mbregex 2020-01-30 11:20:42 +01:00
Nikita Popov
472fc3a2a9 Fix leak in DatePeriod construction with invalid format
Same issue as I fixed in DateInterval construction before.
2020-01-30 11:13:04 +01:00
Nikita Popov
cb7b21009b Merge branch 'PHP-7.4'
* PHP-7.4:
  Reset trampoline on executor startup
  Fix UAF in is_callable() and allocated trampoline
2020-01-30 11:05:56 +01:00
Nikita Popov
98deece6f7 Reset trampoline on executor startup
Make sure the trampoline is usable, even if we had an unclean
shutdown on the last request.
2020-01-30 11:05:04 +01:00
Nikita Popov
429f194f40 Fix UAF in is_callable() and allocated trampoline
By nulling out the function_handler, so it will not get used
below. Reuse the existing helper for this purpose.
2020-01-30 11:04:59 +01:00
Christoph M. Becker
1468484296 Fix #74063: NumberFormatter fails after retrieval from session
While it would be desireable to actually support unserialization of
NumberFormatter instances, at least we should not allow serialization
for now.

We also remove some doubtful tests, which have been added[1] claiming
that they would crash the intl extension, but apparently no fix has
been applied, and the test cases have not been marked as XFAIL.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=ed793b2a3f857fd49c0c1b036062140da5b3e674>
2020-01-30 10:13:29 +01:00
Nikita Popov
7d170eb295 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix shift ub in mbstring
  Restore digit check in mb_decode_numericentity()
2020-01-30 10:08:21 +01:00
Nikita Popov
43465768f1 Fix shift ub in mbstring
Ideally "c" would be an unsigned integer...
2020-01-30 10:07:25 +01:00
Nikita Popov
9aadcb18e1 Restore digit check in mb_decode_numericentity()
I replaced it with a multiplication overflow check in
18599f9c52. However, we need both,
because the code for restoring the number can't handle numbers
with many leading zeros right now and I don't feel like teaching it.
2020-01-30 10:07:01 +01:00
Christoph M. Becker
dda67d3226 Enable ZipArchive::setMtime(Name|Index) on Windows
These are enabled on non Windows systems as of zip 1.16.0 with libzip
>= 1.0.0.  Since Windows builds use at least libzip 1.4.0, we also
enable these methods there.
2020-01-29 18:19:54 +01:00
Nikita Popov
2e97ae91c8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix mb_ord() crash if internal encoding not supported
2020-01-29 16:19:21 +01:00
Nikita Popov
acc616c455 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix mb_ord() crash if internal encoding not supported
2020-01-29 16:19:14 +01:00
Nikita Popov
a62c06c4cf Fix mb_ord() crash if internal encoding not supported
enc_name can be NULL here. Take the name from the mbfl_encoding
instead.
2020-01-29 16:18:46 +01:00
Nikita Popov
b2c8abe951 Merge branch 'PHP-7.4'
* PHP-7.4:
  Better overflow check for entity decoding
2020-01-29 16:08:55 +01:00
Nikita Popov
18599f9c52 Better overflow check for entity decoding
Check for multiplication overflow rather than number of digits.
2020-01-29 16:08:46 +01:00
Nikita Popov
22d2a80031 Merge branch 'PHP-7.4'
* PHP-7.4:
  Reset MBREX(search_re) in RSHUTDOWN
2020-01-29 16:05:47 +01:00
Nikita Popov
085371b299 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Reset MBREX(search_re) in RSHUTDOWN
2020-01-29 16:05:38 +01:00
Nikita Popov
560ff9725e Reset MBREX(search_re) in RSHUTDOWN
This is going to cause a segfault if reused in the next request.
To illustrate the issue, run these two scripts in sequence with
the built-in server:

// script1.php
mb_ereg_search_init('foobar');
mb_ereg_search('foo');

// script2.php
var_dump(mb_ereg_search_init("foobar"));
var_dump(mb_ereg_search_pos());
2020-01-29 16:05:11 +01:00
Remi Collet
b8d635cd22 zip extension version is now 1.16.1 2020-01-29 14:26:03 +01:00
Remi Collet
272698d7fd Merge branch 'PHP-7.4'
* PHP-7.4:
  zip: more constants
2020-01-29 14:25:26 +01:00
Remi Collet
bdcfdd4402 zip: more constants 2020-01-29 14:25:16 +01:00
Anatol Belski
92df876949 Merge branch 'PHP-7.4'
* PHP-7.4:
  Backport 7d2ef3d2e5 into 7.4
2020-01-29 13:40:09 +01:00
Anatol Belski
6352e9a989 Backport 7d2ef3d2e5 into 7.4
As the data structures are public, the fix for 64-bit consists
on replacing the blanket memcpy with individual assignments.
2020-01-29 13:38:46 +01:00
Nikita Popov
42e22a2d91 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix use of mb_ereg_search_getregs() after invalid pattern
2020-01-29 12:50:47 +01:00
Nikita Popov
b3f07afabc Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix use of mb_ereg_search_getregs() after invalid pattern
2020-01-29 12:50:40 +01:00
Nikita Popov
392ad206a4 Fix use of mb_ereg_search_getregs() after invalid pattern
This segfaulted because we assumed that if there are matches,
there must be a regular expression as well.
2020-01-29 12:50:18 +01:00
Anatol Belski
7d2ef3d2e5 Fix datatype
This has been introduced by 84b0d0faba.
Besides it causes runtime issues on POWER5 (and presumably later), the
implementation would expect this array to consist on 32-bit integers.
2020-01-29 12:36:37 +01:00
Nikita Popov
083bbf5140 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix length inconsistency in mb_convert_encoding
2020-01-29 12:22:58 +01:00
Nikita Popov
5589bf4d4a Fix length inconsistency in mb_convert_encoding
Don't mix strlen() and ZSTR_LEN(). If the encoding contains a
NULL byte, this will overflow the buffer.

NULL bytes will still make this behave oddly because the consuming
code will cut off the string there, but let's address that in master...
2020-01-29 12:19:28 +01:00
Nikita Popov
bc32cce6a2 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix recovery of large entities in mb_decode_numericentity()
2020-01-29 11:49:27 +01:00