Commit Graph

114024 Commits

Author SHA1 Message Date
Christoph M. Becker
42e67881c9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Relax test expectation
2020-02-03 13:05:09 +01:00
Christoph M. Becker
b93e4aa11c Relax test expectation
Since we're dealing with floating point numbers, precision issues may
hit us, and actually it's not necessary to check for the exact number
anyway, because it is not exact in the first place.  Therefore, we
relax the test expectations.
2020-02-03 13:03:54 +01:00
Christoph M. Becker
57b9eca83d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79212: NumberFormatter::format() may detect wrong type
2020-02-03 12:29:43 +01:00
Christoph M. Becker
c2935499b1 Fix #79212: NumberFormatter::format() may detect wrong type
We have to convert to number *before* detecting the type, to cater to
internal objects implementing `cast_object`.

We also get rid of the fallback behavior of using `FORMAT_TYPE_INT32`,
because that can no longer happen; after `convert_scalar_to_number_ex`
the type is either `IS_LONG` or `IS_DOUBLE`.  We cater explicitly to
the `IS_ARRAY` case what also avoids triggering a type confusion when
`::TYPE_INT64` is passed as `$type`.
2020-02-03 12:28:32 +01:00
Remi Collet
7fc06635c4 add test 2020-02-03 10:24:45 +01:00
Remi Collet
846e52bd45 NEWS 2020-02-03 10:10:17 +01:00
Remi Collet
3c274613dc Fixed bug #73119 Wrong return for ZipArchive::addEmptyDir Method 2020-02-03 10:10:17 +01:00
Nikita Popov
27fb0b28dd Add WHITESPACE_SENSITIVE run-tests section
This is used to indicate that the test should not be changed by
automated formatting changes.
2020-02-03 10:08:15 +01:00
Nikita Popov
aaf9cbb7eb Disable parallelism for FPM tests
Let's see if this helps with spurious failures on Azure.
2020-02-03 09:57:34 +01:00
Nikita Popov
d422478f6d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #76047
2020-01-31 10:29:45 +01:00
Nikita Popov
ef1e4891b4 Fix bug #76047
Unlink the current stack frame before freeing CVs or extra args.
This means it will no longer show up in back traces that are
generated during CV destruction.

We already did this prior to destructing the object/closure,
presumably for the same reason.
2020-01-31 10:26:40 +01:00
Dmitry Stogov
db7193f31e Fixed bug #79094 (Crashing when running recursion function) 2020-01-31 10:34:04 +03: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
f70b552326 Fixed bug #79193 2020-01-30 14:55:58 +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
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
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
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
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
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
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
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
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
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
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
bdcfdd4402 zip: more constants 2020-01-29 14:25:16 +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
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
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
91f878779c Fix recovery of large entities in mb_decode_numericentity()
Make sure we don't overflow the integer.
2020-01-29 11:48:34 +01:00
Akim Demaille
5265fabc25 Use "%define parse.error verbose"
The YYERROR_VERBOSE macro will no longer be supported in Bison 3.6.
It was superseded by the "%error-verbose" directive in Bison 1.875
(2003-01-01).  Bison 2.6 (2012-07-19) clearly announced that support
for YYERROR_VERBOSE would be removed.  Note that since Bison 3.0
(2013-07-25), "%error-verbose" is deprecated in favor of "%define
parse.error verbose".

Closes GH-5125.
2020-01-29 11:16:30 +01:00
Dmitry Stogov
ce44cd3b3c Fixed bug #79092 (Building with clang+lld-9 results in a broken PHP binary) 2020-01-29 12:15:03 +03:00
Máté Kocsis
d39edebbce
Fix #78666 mysqli_options generates Warning on var_dump()
Closes GH-5121
2020-01-28 18:44:02 +01:00
Nikita Popov
9fcaf25c93 Fix memory leak in mb_str_split 2020-01-28 17:39:49 +01:00
Nikita Popov
8a5bc8c6be Fix mysqli_get_warnings() with multi queries
In this case warning_count may be non-zero, but php_get_warnings()
may still return no warnings. In this case we should return false
rather than returning a corrupted mysqli_warning object.
2020-01-28 17:13:43 +01:00
Christoph M. Becker
addc3c92f2 Fix #79174: cookie values with spaces fail to round-trip
The fix for bug #78929 disabled the conversion of spaces in cookie
values to plus signs, but failed to adapt `php_setcookie()`
accordingly, so that it uses raw URL encoding as well.
2020-01-28 15:37:01 +01:00
Christoph M. Becker
d7052765ed Enable support for LIBZIP_VERSION
This is already supported by non Windows builds for libzip >= 1.3.1,
and since we're using at least libzip 1.4.0 on Windows, we should
support it there as well.
2020-01-28 13:34:07 +01:00
Nikita Popov
1146bdb9b2 Fixed bug #78989
Always operate on copies of the functions, so we don't reference
temporary trait methods that have gone out of scope.

This could be more efficient, but doing an allocated copy only when
strictly necessary turned out to be somewhat tricky.
2020-01-28 10:43:15 +01:00
Christoph M. Becker
e197f65b35 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #76584: PharFileInfo::decompress not working
2020-01-28 10:33:10 +01:00
Christoph M. Becker
136f51f1e1 Fix #76584: PharFileInfo::decompress not working
We actually have to decompress, when told to do so.
2020-01-28 10:31:36 +01:00
Christoph M. Becker
412b476b7f Fix #79172: STRUCT_OFFSET() relies on undefined behavior
Since this pattern is understood by compilers, not a real issue, but
certainly cleaner this way.
2020-01-28 09:18:05 +01:00
Remi Collet
5215f072af - bump zip extension version to 1.15.6
- add ZipArchive::LIBZIP_VERSION
- skip bug53885.phpt with libzip 1.6.0 (empty file is no more valid archive)
2020-01-27 16:47:28 +01:00