Commit graph

505 commits

Author SHA1 Message Date
Christoph M. Becker
11c752a5f5 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80216: imap_mail_compose() does not validate types/encodings
2020-10-12 16:30:48 +02:00
Christoph M. Becker
216d6a024a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80216: imap_mail_compose() does not validate types/encodings
2020-10-12 16:28:52 +02:00
Christoph M. Becker
73e43b6e19 Fix #80216: imap_mail_compose() does not validate types/encodings
We need to check whether the given `type`s and `encoding`s are within
bounds to avoid segfaults and out-of-bound reads.

Closes GH-6323.
2020-10-12 16:27:49 +02:00
Christoph M. Becker
2e17c937bf Merge branch 'PHP-8.0' into master
* PHP-8.0:
  Fix #80223: imap_mail_compose() leaks envelope on malformed bodies
2020-10-12 15:10:55 +02:00
Christoph M. Becker
0443c824a3 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80223: imap_mail_compose() leaks envelope on malformed bodies
2020-10-12 15:10:38 +02:00
Christoph M. Becker
4a469c7e98 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80223: imap_mail_compose() leaks envelope on malformed bodies
2020-10-12 15:09:30 +02:00
Christoph M. Becker
c1962e900a Fix #80223: imap_mail_compose() leaks envelope on malformed bodies
We have to clean up even on failure.

Closes GH-6322.
2020-10-12 15:08:30 +02:00
Christoph M. Becker
c3365bb301 Merge branch 'PHP-8.0' into master
* PHP-8.0:
  Fix #80220: imap_mail_compose() may leak memory
2020-10-12 13:34:42 +02:00
Christoph M. Becker
5a8958f0f3 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80220: imap_mail_compose() may leak memory
2020-10-12 13:34:19 +02:00
Christoph M. Becker
acce991a37 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80220: imap_mail_compose() may leak memory
2020-10-12 13:32:40 +02:00
Christoph M. Becker
0d022ddf03 Fix #80220: imap_mail_compose() may leak memory
Unless `topbod` is of `TYPEMULTIPART`, `mail_free_body()` does not free
the `nested.part`; while we could do this ourselves, instead we just
ignore additional bodies in this case, i.e. we don't attach them in the
first place.

Closes GH-6321.
2020-10-12 13:31:30 +02:00
Christoph M. Becker
d2e5061901 Merge branch 'PHP-8.0' into master
* PHP-8.0:
  Fix #80215: imap_mail_compose() may modify by-val parameters
2020-10-10 23:29:11 +02:00
Christoph M. Becker
6494e57804 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80215: imap_mail_compose() may modify by-val parameters
2020-10-10 23:28:19 +02:00
Christoph M. Becker
7940fb42ce Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80215: imap_mail_compose() may modify by-val parameters
2020-10-10 23:26:12 +02:00
Christoph M. Becker
62a2387a8d Fix #80215: imap_mail_compose() may modify by-val parameters
We separate the input arrays and all sub-arrays to avoid modification
of the passed parameters.

This should be rewritten to use `zend_string`s for the "master" branch.

Closes GH-6316.
2020-10-10 23:25:06 +02:00
Christoph M. Becker
e67814f67b Merge branch 'PHP-8.0' into master
* PHP-8.0:
  Fix #80213: imap_mail_compose() segfaults on certain $bodies
2020-10-10 19:20:13 +02:00
Christoph M. Becker
7d085c87ac Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80213: imap_mail_compose() segfaults on certain $bodies
2020-10-10 19:19:47 +02:00
Christoph M. Becker
b2b9e2e87e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80213: imap_mail_compose() segfaults on certain $bodies
2020-10-10 19:18:14 +02:00
Christoph M. Becker
8bee0fbd37 Fix #80213: imap_mail_compose() segfaults on certain $bodies
We have to cater to non-associative arrays where the key may be `NULL`;
we just skip these elements.

Closes GH-6315.
2020-10-10 19:17:13 +02:00
George Peter Banyard
f211f1586f Fix [-Wlogical-op] in IMAP 2020-10-10 14:45:02 +01:00
Christoph M. Becker
f5afc2c3cf Fix potential mail related segfault on Windows
`rpath` may be `NULL` here, in which case we must not access its
members.
2020-10-08 11:47:18 +02:00
George Peter Banyard
25569679aa Promote warnings to Error in IMAP extension
Drop some dependencies on argc at the same time

Closes GH-6164
2020-09-23 13:54:54 +01:00
George Peter Banyard
5d7d5e2773 Add proper default values for optional arguments in IMAP
Closes GH-6179
2020-09-22 17:46:28 +01:00
George Peter Banyard
7fde9918af Refactor imap_mail()'s internal implementation to use zend_strings 2020-09-22 17:46:28 +01:00
Christoph M. Becker
4591cb8a07 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix memory leak in php_imap_mutf7()
2020-09-21 11:27:51 +02:00
Christoph M. Becker
d1feeed7f3 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix memory leak in php_imap_mutf7()
2020-09-21 11:26:41 +02:00
Christoph M. Becker
730fdc77a7 Fix memory leak in php_imap_mutf7()
We have to free the string which has been allocated by libc-client.
2020-09-21 11:25:46 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
George Peter Banyard
c19887496e Fix [-Wundef] warning in IMAP extension 2020-05-16 15:31:18 +02:00
Máté Kocsis
5322de1ba8
Generate functions entries from stubs for another set of extensions
Closes GH-5351
2020-04-05 00:59:44 +02:00
Máté Kocsis
736b22dc0b
Add stubs for aliases
Closes GH-5187
2020-02-18 21:10:36 +01:00
Máté Kocsis
d1764ca330
Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Máté Kocsis
bbcfa66e06
Use RETURN_THROWS() after zend_fetch_resource*() 2020-01-03 19:20:56 +01:00
Máté Kocsis
7b4a4d2ace
Use RETURN_THROWS() after try_convert_to_string() 2020-01-03 17:04:06 +01:00
Máté Kocsis
345703724c
Use RETURN_THROWS() during ZPP in most of the extensions
Except for some bigger ones: reflection, sodium, spl
2019-12-31 11:46:11 +01:00
Máté Kocsis
9493893412 Cleanup return values when parameter parsing is unsuccessful 2019-10-30 16:05:20 +01:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Stephen Reay
01bdc68379 Added arginfo stubs for IMAP extension 2019-09-22 19:25:55 +02:00
Stephen Reay
c34de80df8 Convert IMAP function aliases
These are not really aliases, convert them to normal functions.

Closes GH-4725.
2019-09-19 17:24:49 +02:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Nikita Popov
ce5e5b0aa3 Use release for regex in imap
The regex may be used as a cache key now.
2019-04-10 10:01:49 +02:00
Nikita Popov
275fa53564 Accept zend_string* instead of char* in php_pcre_match_impl() 2019-03-18 12:32:06 +01:00
Dmitry Stogov
f1b306fe11 Switch to use ZTS cache 2019-03-12 14:15:47 +03:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Dmitry Stogov
22c9d19144 Removed useless zval_ptr_dtor(return_value) 2018-12-26 12:58:11 +03:00
Stanislav Malyshev
c3ca95dad2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix bug #77143 - add more checks to buffer reads
  Fix bug #77143 - add more checks to buffer reads
  Fix #77020: null pointer dereference in imap_mail
2018-12-03 00:43:00 -08:00
Stanislav Malyshev
3d8d13f7b9 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77143 - add more checks to buffer reads
  Fix bug #77143 - add more checks to buffer reads
  Fix #77020: null pointer dereference in imap_mail
  Don't need interactive progress on git clones in Travis
  Fix TSRM signature - php_stream_stat macro has it's own TSRM
  Regenerate certificates for openssl tests
  Improve test for bug77022
2018-12-03 00:42:55 -08:00
Stanislav Malyshev
8fff90250b Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77143 - add more checks to buffer reads
  Fix bug #77143 - add more checks to buffer reads
  Fix #77020: null pointer dereference in imap_mail
2018-12-03 00:42:50 -08:00
Stanislav Malyshev
8ab5d22332 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #77143 - add more checks to buffer reads
  Fix bug #77143 - add more checks to buffer reads
  Fix #77020: null pointer dereference in imap_mail
2018-12-03 00:42:45 -08:00