Commit Graph

101698 Commits

Author SHA1 Message Date
Christopher Jones
eceb34073b Remove trailing whitespace to help keep branches in sycn 2018-09-24 09:37:46 +10:00
Christoph M. Becker
9cbe1283f7 Fix #66828: iconv_mime_encode Q-encoding longer than it should be
Before the fix for bug 48289 has been applied, the algorithm to
construct a Q-encoded-word has been optimistic, i.e. try to encode as
many bytes that *may* fit in the remaining space, calculate the actual
length of the Q-encoded word, and if it's too long, try again with a
reduced size.  However, the fix for the mentioned bug replaced this by
a pessimistic algorithm, which always terminates[1] the for loop[2]
during the first iteration (which renders the following 3 lines as dead
code), and as such easily produces unnecessarily short encoded-words.
Instead the proper fix for the bug would have been to make sure that
`out_size` is always decremented, if the space isn't sufficient for the
encoded-word.

[1] <https://github.com/php/php-src/blob/php-7.3.0beta3/ext/iconv/iconv.c#L1421>
[2] <https://github.com/php/php-src/blob/php-7.3.0beta3/ext/iconv/iconv.c#L1360>
2018-09-22 15:20:20 +02:00
Nikita Popov
842bec5b3c Fix getColumnMeta() test
Newer MySQL versions are stricter about invalid values. Three issues
are fixed:

* Don't use negative values with ZEROFILL. ZEROFILL implies UNSIGNED.
* Use a legal TIMESTAMP value. TIMESTAMP does not accept a Unix timestamp.
* Specify BIGINT values as strings, to avoid overflows.

This is a cherry-pick of d2dc0a3291 from master.
2018-09-19 12:29:38 +02:00
Nikita Popov
c614dd677c Fix intermittent failures in mysqli_stmt_bind_result_format.phpt
There were two distinct issues here:
 * $trend was compared against 'NULL' using !=, which does not work
   as intended in the case where $trend==0.0.
 * current_targets was declared as double(17,0), which means that
   the fractional part was rounded, so that the same comparison in
   SQL (rounded) and in PHP (not rounded) did not necessarily
   match.

Please don't write mt_rand based tests, it takes ages to debug this
crap...
2018-09-19 12:27:31 +02:00
Nikita Popov
294fb83ee8 Fixed bug #76901
get_method() may modify the object pointer passed to it if method
forwarding is used. In this case we do not want to modify the
passed zval, so make sure that we copy the object into a temporary
first.
2018-09-19 09:37:04 +02:00
Manabu Matsui
ab6c45f524 Fix bug #75533: array_reduce is slow when $carry is large array 2018-09-18 20:49:59 +02:00
Anatol Belski
be02b2e8fd Add spectre switch for suitable vc14 versions 2018-09-18 10:43:52 +02:00
Pierrick Charron
3bb218a0a7 Fix 76480: Use curl_multi_wait() so that timeouts are respected 2018-09-17 20:28:44 -04:00
Anatol Belski
d77ac7b3dc Sync version for vc++ 15.9 2018-09-13 19:25:23 +02:00
Anatol Belski
19ab91781e Improve error code matching 2018-09-12 16:22:22 +02:00
Anatol Belski
49511a5132 Update binary SDK version for AppVeyor 2018-09-12 12:09:32 +02:00
Ferenc Kovacs
68a77fe3d8 Merge branch 'PHP-7.0' into PHP-7.1 2018-09-12 00:02:18 +02:00
Ferenc Kovacs
cba6055cac Merge branch 'PHP-5.6' into PHP-7.0 2018-09-12 00:00:46 +02:00
Ferenc Kovacs
81f23057dc 5.6.39 will be the next 2018-09-11 23:58:17 +02:00
Anatol Belski
af80ff25f6 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  7.0.33 next
2018-09-11 07:00:48 +02:00
Anatol Belski
1b89522974 7.0.33 next 2018-09-11 07:00:15 +02:00
Anatol Belski
df45faf446 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Sync NEWS [ci skip]
2018-09-10 16:57:24 +02:00
Anatol Belski
4415dab25e Sync NEWS [ci skip] 2018-09-10 16:56:37 +02:00
Stanislav Malyshev
6623f3caca Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Update NEWS
  Fix for bug #76582
2018-09-09 12:29:23 -07:00
Stanislav Malyshev
024f3ac160 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Update NEWS
  Fix for bug #76582
2018-09-09 12:27:44 -07:00
Stanislav Malyshev
c1de84014d Update NEWS 2018-09-09 12:19:38 -07:00
Stanislav Malyshev
23b057742e Fix for bug #76582
The brigade seems to end up in a messed up state if something fails
in shutdown, so we clean it up.
2018-09-09 11:45:14 -07:00
Jakub Zelenka
be50a72715 Fix ssl stream reneg limit test to print only after first renegotiation
It has been reported that in some setup the test does multiple
renegotiations which is allowed.
2018-09-09 18:53:55 +01:00
Christoph M. Becker
90d863898c Fix #75273: php_zlib_inflate_filter() may not update bytes_consumed
Whenever we return with `PSFS_PASS_ON`, we need to update
`bytes_consumed` to not mislead the caller.  Instead of fixing the
respective `if` clauses, we eschew the early bail-outs to simplify the
code a bit.
2018-09-08 19:01:36 +02:00
Anatol Belski
28c6125053 Sync with recent changes to default libcurl build
(cherry picked from commit a1ba3007a4)
2018-09-05 21:28:59 +02:00
Christoph M. Becker
c0a389a927 Fix #74454: Wrong exception being thrown when using ReflectionMethod
If zend_throw_exception_ex() already threw an exception, we should not
throw again.
2018-09-05 15:05:19 +02:00
Ville Hukkamaki
0f724453c0
Fix bug #74764 and add a test case 2018-09-04 11:12:04 +02:00
Anatol Belski
e58690a26d [ci skip] Update NEWS 2018-09-04 11:01:24 +02:00
Nikita Popov
03740ef7df Revert all MySQL auth related changes
Per bug #76651 these changes do not appear to work correctly in
some cases. As no immediate fix seems to be forthcoming, I'm
reverting these changes.

Revert "Fixed invalid free introduced by d6e81f0bfd (avoid keeping "invalid" pointer)"

This reverts commit 11507c0e1b.

Revert "Fix mysqlnd build without openssl"

This reverts commit 6c9db02ff7.

Revert "Fix VC compilation as variable size array is not supported"

This reverts commit f96df64cb2.

Revert "Fix MySQL 8 auth"

This reverts commit d6e81f0bfd.
2018-09-04 05:47:28 +02:00
Nikita Popov
f1f39d7ed7 Fix parenthesis warning 2018-09-04 05:32:25 +02:00
Peter Kokot
870d893d0b Fix bug #75481: makedev warning
To use makedev the sys/sysmacros.h needs to be included on newer
systems.

Cherry-picked from PHP-7.3.
2018-09-04 05:13:45 +02:00
Ville Hukkamaki
742783c3ee Fixed bug #73457
Correctly report errors when opening FTP data connection.
2018-09-04 04:53:38 +02:00
Anatol Belski
f26172f934 Fixed bug #76832 ZendOPcache.MemoryBase periodically deleted by the OS 2018-09-03 15:09:23 +02:00
Dmitry Stogov
7fde2243a7 Fixed reference-countingin ZTS build. 2018-09-03 10:20:40 +03:00
Christoph M. Becker
2677d43850 Fix #75696: posix_getgrnam fails to print details of group
According to the POSIX specification of `getgrnam_r()` the result of
`sysconf(_SC_GETGR_R_SIZE_MAX)` is an initial value suggested for the
size of the buffer, and `ERANGE` signals that insufficient storage was
supplied.  So if we get `ERANGE`, we try again with a buffer twice as
big, and so on, instead of failing.
2018-09-01 14:25:59 +02:00
Anatol Belski
7fb7869e13 Fix stack underflow in phar
The checks can issue reads below and above the temporary buffer. A read
itself doesn't seem dangerous, but the condition result can be
arbitrary. Such reads have to be avoided. Likely this patch should be
backported.

(cherry picked from commit b053beee7e)
2018-08-30 19:33:07 +02:00
Remi Collet
c1729272b1 fix double cast to int on 32-bit 2018-08-30 09:03:50 +02:00
Dmitry Stogov
709e4e4f17 Fixed incorrect ZEND_ACC_ARENA_ALLOCATED usage (it must be used only for internal functions). 2018-08-29 23:40:17 +03:00
Sara Golemon
5fee4e7108
Prep for 7.1.23 2018-08-29 12:41:05 -04:00
Christoph M. Becker
efb86aef12 Fix #68180: iconv_mime_decode can return extra characters in a header
Basically, the algorithm to append a converted string to an existing
`smart_str` works by increasing the `smart_str` buffer, to let `iconv`
convert characters until there is no more space, to set the new length
of the `smart_str` and to repeat until there is no more input.

Formerly, the new length calculation has been wrong, though, since we
would have to take the old `out_len` into account (`buf_growth -
old_out_len - out_len`).  However, since there is no need to take the
old `out_len` into account when increasing the `smart_str` buffer, we
can simplify the fix, avoiding an additional variable.
2018-08-26 13:18:35 +02:00
Christoph M. Becker
e29c946c29 Fix #60494: iconv_mime_decode does ignore special characters
We must not ignore erroneous characters in mime headers, but rather let
iconv_mime_decode() fail in this case, issuing the usual notice
regarding illegal characters.
2018-08-25 17:40:39 +02:00
Christoph M. Becker
8754d44167 Fix #63839: iconv_mime_decode_headers function is skipping headers
We have to cater to the possibility that `=?` is not the start of an
encoded-word, but rather a literal `=?`.  If a line break is found
while we're still looking for the charset, we can safely assume that
it's a literal `=?`, and act accordingly.
2018-08-25 14:51:13 +02:00
Christoph M. Becker
6e1980e152 Fix #55146: iconv_mime_decode_headers() skips some headers
If we're expecting the start of an encoded word (`=?`), but instead of
the question mark get a line break (CR or LF), we must not append it to
the `pretval`.
2018-08-25 14:40:07 +02:00
Dylan K. Taylor
b9bf9ddce6 mkdist.php: recursively check dll dependencies
Fix duplication of recursively checked deps
2018-08-23 21:25:54 +02:00
Christoph M. Becker
6644bd005f Simplify regression test
There's no need to actually try to trigger an out-of-memory condition
to proof the leak; instead we can simply rely on the Zend MM to report
the memory leaks in debug mode (at least on Linux).  Therefore we
simplify the regression test, which also makes it run much faster.
2018-08-23 12:48:09 +02:00
Christoph M. Becker
32a728d351 Fix #68825: Exception in DirectoryIterator::getLinkTarget()
intern->file_name may not have been properly set when
DirectoryIterator::getLinkTarget() is called, so we make sure it is
before using it.
2018-08-22 15:37:02 +02:00
Christoph M. Becker
5fb01a3a42 Increase memory_limit to prevent test failures 2018-08-22 14:29:28 +02:00
Christoph M. Becker
70b2fca220 Fix #76778: array_reduce leaks memory if callback throws exception
We have to release the result variable in the error case, too.
2018-08-22 13:40:24 +02:00
Ville Hukkamaki
cf2fc66b02 Fixed bug #76777 and added test
Set undefined values to null rather than undefined.
2018-08-22 12:51:06 +02:00
Jakub Zelenka
4c542e6c13 Fix bug #76705 (unusable ssl => peer_fingerprint in stream_context_create()) 2018-08-19 20:14:26 +01:00