Commit Graph

114013 Commits

Author SHA1 Message Date
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
Máté Kocsis
ea1b878877
Fix #78969 Make PASSWORD_DEFAULT match PASSWORD_BCRYPT instead of being null
It was an unintentional BC break.
2020-01-27 13:57:00 +01:00
Nikita Popov
1cccbb8ff1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #78323: Code 0 is returned on invalid options
2020-01-27 13:32:38 +01:00
Ivan Mikheykin
fd08f062ae Fix bug #78323: Code 0 is returned on invalid options
Set CLI exit code to 1 when invalid parameters are passed,
and print error to stderr.
2020-01-27 13:32:19 +01:00
Christoph M. Becker
41e1891e0c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add CURLOPT CURLOPT_HTTP09_ALLOWED available since 7.64.0
2020-01-26 14:13:52 +01:00
Florian Smeets
b836d9cdc1 Add CURLOPT CURLOPT_HTTP09_ALLOWED available since 7.64.0 2020-01-26 14:12:53 +01:00
George Peter Banyard
86f463c396 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79080 [ci skip]
2020-01-25 13:31:10 +01:00
George Peter Banyard
a1f2f8f06e Fixed bug #79080 [ci skip]
Rewrote session.gc_probability and session.gc_divisor INI setting
description to be more succint.
2020-01-25 13:29:36 +01:00
Nikita Popov
3291891408 Fixed bug #79128
We need to extend the hash table before performing raw append
operations.

This doesn't matter if preloading happens in the same process,
as the tables will be large enough to hold all entries as a
side-effect of the preloading process. However, if preloading
happens in a different process, we need to reserve space here.
2020-01-24 16:18:48 +01:00
Nikita Popov
c14df824d1 Fix mysqli ssl test for tls1.3
Specifying AES256-SHA results in TLS_AES_256_GCM_SHA384 if the
connection uses TLS v1.3.
2020-01-24 15:14:52 +01:00
Nikita Popov
bb5cdd9b74 Fixed bug #79011
auth_plugin_data_len here is 21, including the trailing null byte.
Directly use SCRAMBLE_LENGTH instead. Also add a sanity check that
the provided scramble is long enough.
2020-01-24 14:54:46 +01:00
Nikita Popov
555567468a Fix memory leaks in mysqlnd debug functionality 2020-01-24 14:54:46 +01:00