Commit Graph

114976 Commits

Author SHA1 Message Date
Christoph M. Becker
f547412cba Fix #79177: FFI doesn't handle well PHP exceptions within callback
We have to error on unhandled exceptions in FFI callbacks, to avoid
passing back undefined values.

This has been discussed and agreed upon in a previous PR[1].

[1] <https://github.com/php/php-src/pull/5120>

Closes GH-6366.
2020-10-28 13:34:56 +01:00
Nikita Popov
68dcaa29d8 Fixed bug #66528
Report errors in commit, rollback and autocommit handlers.
2020-10-28 12:18:02 +01:00
Dmitry Stogov
68f80be9d1 Fixed run-time binding of preloaded dynamically declared function 2020-10-28 13:50:14 +03:00
Dharman
990bb34891 Handle mysqli errors in more cases
Report errors autocommit, commit, rollback and mysqli_stmt_attr_set.

Additionally, copy the error from conn to stmt when preparing fails,
so these errors are also handled by mysqli_stmt_prepare.

Closes GH-6157.
2020-10-28 11:33:50 +01:00
Nikita Popov
fe55fe1f54 Sync test with master
Sync ext/mysqli/tests/mysqli_report.phpt with PHP-8.0/master, as
the current difference in indentation makes it hard to merge.
2020-10-28 11:30:22 +01:00
Dharman
b03776adb5 Fix bug #79375
Make sure deadlock errors are properly propagated and reports in
a number of places in mysqli and PDO MySQL.

This also fixes a memory and a segfault that can occur under these
conditions.
2020-10-28 11:01:47 +01:00
Nikita Popov
9353f11bd2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Deny cloning of fileinfo objects
2020-10-26 16:50:48 +01:00
Nikita Popov
7817fc07e1 Deny cloning of fileinfo objects
Using a cloned finfo object will crash.
2020-10-26 16:50:20 +01:00
Christoph M. Becker
cf5d46ba94 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Revert "Fix out-of-bounds write"
2020-10-26 15:40:55 +01:00
Christoph M. Becker
be6d72b3a4 Revert "Fix out-of-bounds write"
This reverts commit bf6873a18e.

CVE-2020-26159 is bogus; the "bug" was apparently a false positive
reported by Coverity, and the "fix" apparently wrong, see
<https://github.com/kkos/oniguruma/issues/221>.

Closes GH-6357.
2020-10-26 15:40:12 +01:00
Christoph M. Becker
7bc1c0cca8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80268: loadHTML() truncates at NUL bytes
2020-10-26 13:09:30 +01:00
Christoph M. Becker
6d2bc72530 Fix #80268: loadHTML() truncates at NUL bytes
libxml2 has no particular issues parsing HTML strings with NUL bytes;
these just cause truncation of the current text content, but parsing
continues generally.  Since `::loadHTMLFile()` already supports NUL
bytes, `::loadHTML()` should as well.

Note that this is different from XML, which does not allow any NUL
bytes.

Closes GH-6368.
2020-10-26 13:08:05 +01:00
Nikita Popov
31aca85572 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Declare may_retry_reparse_point on windows only
2020-10-26 12:40:56 +01:00
Nikita Popov
824cbc2781 Declare may_retry_reparse_point on windows only 2020-10-26 12:40:45 +01:00
Christoph M. Becker
f9ba2ca136 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #62474: com_event_sink crashes on certain arguments
2020-10-26 11:54:45 +01:00
Christoph M. Becker
7424bfc7ac Fix #62474: com_event_sink crashes on certain arguments
We have to make sure that the variant is of type `VT_DISPATCH` before
we access it as such.

Closes GH-6372.
2020-10-26 11:48:57 +01:00
Christoph M. Becker
ac2e9587fb Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80258: Windows Deduplication Enabled, randon permission errors
2020-10-26 11:21:52 +01:00
Christoph M. Becker
848e24f24d Fix #80258: Windows Deduplication Enabled, randon permission errors
A recent bug fix regarding symlinks claimed:

> After resolving reparse points, the path still may be a reparse
> point; in that case we have to resolve that reparse point as well.

While that is basically correct, some reparse points may point to
inaccessible system folders (e.g. `IO_REPARSE_TAG_DEDUP` points to
"\System Volume Information").  Since we don't know details about
arbitrary reparse points, and are mainly interested in nested symlinks,
we take a step back, and only resolve `IO_REPARSE_TAG_SYMLINK` for now.

Close GH-6354.
2020-10-26 11:21:14 +01:00
Christoph M. Becker
8b59e4e897 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80280: ADD_EXTENSION_DEP() fails for ext/standard and ext/date
2020-10-26 11:05:22 +01:00
Christoph M. Becker
2be27074b6 Fix #80280: ADD_EXTENSION_DEP() fails for ext/standard and ext/date
`ADD_EXTENSION_DEP()` relies on the `PHP_<extname>` config variables to
be set to `"yes"`, and since the standard and date extension are always
enabled, we define the respective variables uncoditionally.

Closes GH-6383.
2020-10-26 11:03:05 +01:00
Christoph M. Becker
2e84f4d16a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug 76618
2020-10-26 10:58:26 +01:00
George Peter Banyard
d5e2431884 Fix bug 76618
Apply patch which was attached to the bug in July 2018
2020-10-22 17:05:07 +01:00
George Peter Banyard
12a09183b3 Fix bug 76618
Apply patch which was attached to the bug in July 2018
2020-10-22 17:01:48 +01:00
Nikita Popov
85d9a1ca6e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Don't crash on uninitialized tidy object
2020-10-22 16:05:34 +02:00
Nikita Popov
d4bf0799b8 Don't crash on uninitialized tidy object
"Uninitialized" here means that the object was created ordinarily
-- no constructor skipping involved. Most tidy methods seem to
handle this fine, but these three need to be guarded.
2020-10-22 16:04:22 +02:00
Derick Rethans
4ea01bdc67 Updated to version 2020.4 (2020d) 2020-10-22 10:12:26 +01:00
Derick Rethans
c7c87515f6 Empty merge 2020-10-22 10:12:25 +01:00
Derick Rethans
d4200ba6cf Updated to version 2020.4 (2020d) 2020-10-22 10:12:24 +01:00
Christoph M. Becker
4ef7be20ab Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80242: imap_mail_compose() segfaults for multipart with rfc822
2020-10-20 19:00:16 +02:00
Christoph M. Becker
315b95b065 Fix #80242: imap_mail_compose() segfaults for multipart with rfc822
libc-client expects `TYPEMESSAGE` with an explicit subtype of `RFC822`
to have a `nested.msg` (otherwise there will be a segfault during
free), but not to have any `contents.text.data` (this will leak
otherwise).

Closes GH-6345.
2020-10-20 18:58:45 +02:00
Christoph M. Becker
a54f0f7680 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Add char* cast to avoid compiler warnings
2020-10-20 16:31:25 +02:00
Christoph M. Becker
de58fb34c9 Add char* cast to avoid compiler warnings
In libc-client 2007f `data` is declared as `unsigned char *`; there may
be variants which declare it as `void *`, but in any case picky
compilers may warn about a pointer type mismatch in the conditional
(and error with `-W-error`), so we're adding a `char *` cast for good
measure.
2020-10-20 16:29:42 +02:00
Christoph M. Becker
9cfd650697 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Properly fix #80220
2020-10-20 13:35:06 +02:00
Christoph M. Becker
7f3bdda29b Properly fix #80220
The original fix for that bug[1] broke the formerly working composition
of message/rfc822 messages, which results in a segfault when freeing
the message body now.  While `imap_mail_compose()` does not really
support composition of meaningful message/rfc822 messages (although
libc-client appears to support that), some code may still use this to
compose partial messages, and using string manipulation to create the
final message.

The point is that libc-client expects `TYPEMESSAGE` with an explicit
subtype of `RFC822` to have a `nested.msg` (otherwise there will be a
segfault during free), but not to have any `contents.text.data` (this
will leak otherwise).

[1] <http://git.php.net/?p=php-src.git;a=commit;h=0d022ddf03c5fabaaa22e486d1e4a367ed9170a7>

Closes GH-6343.
2020-10-20 13:32:53 +02:00
twosee
d134c0ac05 Fix bug #79643: Invalid memory read when opcache.interned_strings_buffer is 0 2020-10-20 12:50:28 +02:00
Nikita Popov
1359f793ee Fix CCM tag length setting for old OpenSSL versions
While OpenSSL 1.1 allows unconditionally setting the CCM tag length
even for decryption, some older versions apparently do not. As such,
we do need to treat CCM and OCB separately after all.
2020-10-20 10:50:50 +02:00
Nikita Popov
750a74ed9c Fix bug #79983: Add support for OCB mode
OCB mode ciphers were already exposed to openssl_encrypt/decrypt,
but misbehaved, because they were not treated as AEAD ciphers.
From that perspective, OCB should be treated the same way as GCM.
In OpenSSL 1.1 the necessary controls were unified under
EVP_CTRL_AEAD_* (and OCB is only supported since OpenSSL 1.1).

Closes GH-6337.
2020-10-19 11:09:00 +02:00
Derick Rethans
a4c1a43a5b Updated to version 2020.3 (2020c) 2020-10-19 09:31:03 +01:00
Derick Rethans
d8ff075f12 Empty merge 2020-10-19 09:31:03 +01:00
Derick Rethans
7b5f232b03 Updated to version 2020.3 (2020c) 2020-10-19 09:31:02 +01:00
Christoph M. Becker
bc214c8423 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix broken fix for #80239
2020-10-15 13:19:30 +02:00
Christoph M. Becker
4b9db65f68 Fix broken fix for #80239
No idea why that `git am` failed that badly.
2020-10-15 13:18:34 +02:00
Christoph M. Becker
7899ac4c14 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80239: imap_rfc822_write_address() leaks memory
2020-10-15 12:56:02 +02:00
Christoph M. Becker
5941b30bb8 Fix #80239: imap_rfc822_write_address() leaks memory
We have to free the address when we're finished with it.
2020-10-15 12:54:53 +02:00
Nikita Popov
fb246bec14 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix leak in gmp_export()
2020-10-15 10:16:56 +02:00
Nikita Popov
a29016d70d Fix leak in gmp_export() 2020-10-15 10:16:22 +02:00
Nikita Popov
6c6a58e930 Allow passing $tag for non-authenticated encryption
openssl_encrypt() currently throws a warning if the $tag out
parameter is passed for a non-authenticated cipher. This violates
the principle that a function should behave the same if a parameter
is not passed, and if the default value is passed for the parameter.

I believe this warning should simply be dropped and the $tag be
populated with null, as is already the case. Otherwise, it is not
possible to use openssl_encrypt() in generic wrapper APIs, that are
compatible with both authenticated and non-authenticated encryption.

Closes GH-6333.
2020-10-14 10:54:06 +02:00
Christoph M. Becker
d9058b61fb Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #64076: imap_sort() does not return FALSE on failure
2020-10-13 19:38:31 +02:00
Christoph M. Becker
db8bf0a9e0 Fix #64076: imap_sort() does not return FALSE on failure
If unsupported `$search_criteria` are passed to `imap_sort()`, the
function returns an empty array, but there is also an error on the
libc-client error stack ("Unknown search criterion: UNSUPPORTED
(errflg=2)").  If, on the other hand, unsupported `$criteria` or
unsupported `$flags` are passed, the function returns `false`.  We
solve this inconsistency by returning `false` for unsupported
`$search_criteria` as well.

Closes GH-6332.
2020-10-13 19:37:05 +02:00
Derick Rethans
8fd8a1b128 Prepare for 7.4.13 2020-10-13 12:28:58 +01:00