Commit Graph

117326 Commits

Author SHA1 Message Date
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
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
Nikita Popov
a73df8e5f9 Merge branch 'PHP-7.4'
* PHP-7.4:
  Use "%define parse.error verbose"
2020-01-29 11:16:38 +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
8bdce8edab Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79092 (Building with clang+lld-9 results in a broken PHP binary)
2020-01-29 12:15:34 +03: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
cffff1fb03
Merge branch 'PHP-7.4'
* Fix #78666 mysqli_options generates Warning on var_dump()
2020-01-28 18:51:00 +01: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
38d205a5b1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix memory leak in mb_str_split
2020-01-28 17:40:07 +01:00
Nikita Popov
9fcaf25c93 Fix memory leak in mb_str_split 2020-01-28 17:39:49 +01:00
Nikita Popov
7d3a6e7149 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix mysqli_get_warnings() with multi queries
2020-01-28 17:17:07 +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
0563dfee1b Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79174: cookie values with spaces fail to round-trip
2020-01-28 15:37:51 +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
Nikita Popov
d91b166c3a Avoid shift UB for large arrays
Don't shift into the sign bit.
2020-01-28 15:34:08 +01:00
Nikita Popov
7db3a51884 Only fetch to_encoding once in mb_convert_encoding()
Instead of doing it on every conversion. This is both more efficient
and avoids generating multiple warnings.
2020-01-28 15:12:24 +01:00
Nikita Popov
b0d7b126a2 Make BG(syslog_device) per request
This is not supposed to be retained across requests. Explicitly
free it at the end of a request, and use the per-request allocator.
2020-01-28 14:44:52 +01:00
Christoph M. Becker
3b9e822e11 Merge branch 'PHP-7.4'
* PHP-7.4:
  Enable support for LIBZIP_VERSION
2020-01-28 13:35:20 +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
648f16c2ec Fix rel_date leak on DateInterval construction failure 2020-01-28 13:11:49 +01:00
Nikita Popov
2342c06584 Throw an exception if default_dir not set, but required
Previously the RETURN_THROWS() assertion failed for this case.
2020-01-28 12:35:35 +01:00
Remi Collet
d91abf76e0 zip: fix lib check 2020-01-28 11:32:42 +01:00
Nikita Popov
c59219de85 Perform map ptr base arithmetic through uintptr_t
Adding an offset to the NULL pointer is undefined behavior.
Avoid this by performing arithmetic on uintptr_t instead.
2020-01-28 11:24:04 +01:00
Nikita Popov
521c405108 Don't index NULL pointer when fetching non-existent constant 2020-01-28 11:20:57 +01:00
Remi Collet
ac9a265f01 - bump zip extension version to 1.16.0 - add ZipArchive::setMtimeName and ZipArchive::setMtimeIndex methods 2020-01-28 10:53:49 +01:00
Nikita Popov
3bae1793ab Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78989
2020-01-28 10:44:37 +01:00