summaryrefslogtreecommitdiff
path: root/ext/imap/php_imap.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug 76618George Peter Banyard2020-10-221-1/+1
| | | | Apply patch which was attached to the bug in July 2018
* Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-10-201-9/+13
|\ | | | | | | | | * PHP-7.3: Fix #80242: imap_mail_compose() segfaults for multipart with rfc822
| * Fix #80242: imap_mail_compose() segfaults for multipart with rfc822Christoph M. Becker2020-10-201-9/+13
| | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-10-201-1/+1
|\ \ | |/ | | | | | | * PHP-7.3: Add char* cast to avoid compiler warnings
| * Add char* cast to avoid compiler warningsChristoph M. Becker2020-10-201-1/+1
| | | | | | | | | | | | | | | | 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.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-10-201-9/+13
|\ \ | |/ | | | | | | * PHP-7.3: Properly fix #80220
| * Properly fix #80220Christoph M. Becker2020-10-201-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-10-151-2/+2
|\ \ | |/ | | | | | | * PHP-7.3: Fix broken fix for #80239
| * Fix broken fix for #80239Christoph M. Becker2020-10-151-2/+2
| | | | | | | | No idea why that `git am` failed that badly.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-10-151-0/+1
|\ \ | |/ | | | | | | * PHP-7.3: Fix #80239: imap_rfc822_write_address() leaks memory
| * Fix #80239: imap_rfc822_write_address() leaks memoryChristoph M. Becker2020-10-151-0/+1
| | | | | | | | We have to free the address when we're finished with it.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-10-131-0/+3
|\ \ | |/ | | | | | | * PHP-7.3: Fix #64076: imap_sort() does not return FALSE on failure
| * Fix #64076: imap_sort() does not return FALSE on failureChristoph M. Becker2020-10-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Ignore memory leaks reported for some libc-client functionsChristoph M. Becker2020-10-131-0/+6
| | | | | | | | | | | | | | | | At least on Windows, some static variables are lazily initialized during `mail_open()` and `mail_lsub()`, which are reported as memory leaks. We suppress these false positives. Closes GH-6326.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-10-121-0/+1
|\ \ | |/ | | | | | | * PHP-7.3: Fix #80226: imap_sort() leaks sortpgm memory
| * Fix #80226: imap_sort() leaks sortpgm memoryChristoph M. Becker2020-10-121-0/+1
| | | | | | | | | | | | We need to free what we have allocated. Closes GH-6327.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-10-121-9/+18
|\ \ | |/ | | | | | | * PHP-7.3: Fix #80216: imap_mail_compose() does not validate types/encodings
| * Fix #80216: imap_mail_compose() does not validate types/encodingsChristoph M. Becker2020-10-121-9/+18
| | | | | | | | | | | | | | 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.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-10-121-2/+4
|\ \ | |/ | | | | | | * PHP-7.3: Fix #80223: imap_mail_compose() leaks envelope on malformed bodies
| * Fix #80223: imap_mail_compose() leaks envelope on malformed bodiesChristoph M. Becker2020-10-121-2/+4
| | | | | | | | | | | | We have to clean up even on failure. Closes GH-6322.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-10-121-1/+1
|\ \ | |/ | | | | | | * PHP-7.3: Fix #80220: imap_mail_compose() may leak memory
| * Fix #80220: imap_mail_compose() may leak memoryChristoph M. Becker2020-10-121-1/+1
| | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-10-101-1/+8
|\ \ | |/ | | | | | | * PHP-7.3: Fix #80215: imap_mail_compose() may modify by-val parameters
| * Fix #80215: imap_mail_compose() may modify by-val parametersChristoph M. Becker2020-10-101-1/+8
| | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-10-101-0/+4
|\ \ | |/ | | | | | | * PHP-7.3: Fix #80213: imap_mail_compose() segfaults on certain $bodies
| * Fix #80213: imap_mail_compose() segfaults on certain $bodiesChristoph M. Becker2020-10-101-0/+4
| | | | | | | | | | | | | | We have to cater to non-associative arrays where the key may be `NULL`; we just skip these elements. Closes GH-6315.
* | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-09-211-1/+2
|\ \ | |/ | | | | | | * PHP-7.3: Fix memory leak in php_imap_mutf7()
| * Fix memory leak in php_imap_mutf7()Christoph M. Becker2020-09-211-1/+2
| | | | | | | | We have to free the string which has been allocated by libc-client.
* | Allow exceptions in __toString()Nikita Popov2019-06-051-3/+9
| | | | | | | | | | | | | | | | | | | | 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.
* | Use release for regex in imapNikita Popov2019-04-101-2/+2
| | | | | | | | The regex may be used as a cache key now.
* | Accept zend_string* instead of char* in php_pcre_match_impl()Nikita Popov2019-03-181-1/+1
| |
* | Switch to use ZTS cacheDmitry Stogov2019-03-121-0/+6
| |
* | Remove local variablesPeter Kokot2019-02-031-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Remove yearly range from copyright noticeZeev Suraski2019-01-301-1/+1
| |
* | Removed useless zval_ptr_dtor(return_value)Dmitry Stogov2018-12-261-2/+2
| |
* | Merge branch 'PHP-7.3'Stanislav Malyshev2018-12-031-1/+0
|\ \ | |/ | | | | | | | | | | * 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
| * Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2018-12-031-1/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| | * Merge branch 'PHP-7.1' into PHP-7.2Stanislav Malyshev2018-12-031-1/+0
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | * 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
| | | * Merge branch 'PHP-7.0' into PHP-7.1Stanislav Malyshev2018-12-031-1/+0
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| | | | * Merge branch 'PHP-5.6' into PHP-7.0Stanislav Malyshev2018-12-031-1/+0
| | | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-5.6: Fix bug #77143 - add more checks to buffer reads Fix #77020: null pointer dereference in imap_mail
| | | | | * Fix #77020: null pointer dereference in imap_mailStanislav Malyshev2018-12-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If an empty $message is passed to imap_mail(), we must not set message to NULL, since _php_imap_mail() is not supposed to handle NULL pointers (opposed to pointers to NUL).
* | | | | | Clean up unnecessary ternary expressions and simplify some returnsGabriel Caruso2018-12-031-5/+2
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Simplify conditions - Use ZEND_HASH_APPLY_* instead of hard-coded booleans - Use ZEND_NORMALIZE_BOOL - Drop sign in favor of ZEND_NORMALIZE_BOOL
* | | | | Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2018-11-281-0/+2
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.2: Add DISPLAY_INI_ENTRIES for imap Disable rsh/ssh functionality in imap by default (bug #77153) Disable rsh/ssh functionality in imap by default (bug #77153)
| * | | | Merge branch 'PHP-7.1' into PHP-7.2Stanislav Malyshev2018-11-281-0/+2
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.1: Add DISPLAY_INI_ENTRIES for imap Disable rsh/ssh functionality in imap by default (bug #77153) Disable rsh/ssh functionality in imap by default (bug #77153)
| | * | | Merge branch 'PHP-7.0' into PHP-7.1Stanislav Malyshev2018-11-281-0/+2
| | |\ \ \ | | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.0: Add DISPLAY_INI_ENTRIES for imap Disable rsh/ssh functionality in imap by default (bug #77153) Disable rsh/ssh functionality in imap by default (bug #77153)
| | | * | Merge branch 'PHP-5.6' into PHP-7.0Stanislav Malyshev2018-11-281-0/+2
| | | |\ \ | | | | |/ | | | | | | | | | | | | | | | * PHP-5.6: Add DISPLAY_INI_ENTRIES for imap
| | | | * Add DISPLAY_INI_ENTRIES for imapStanislav Malyshev2018-11-281-0/+2
| | | | |
| | | | * Disable rsh/ssh functionality in imap by default (bug #77153)Stanislav Malyshev2018-11-201-0/+17
| | | | |
| | | | * Merge remote-tracking branch 'phpsec/PHP-5.6.28' into PHP-5.6Anatol Belski2016-11-081-1/+1
| | | | |\
| | | | | * Fixed bug #73418 Integer Overflow in "_php_imap_mail" leads to crashAnatol Belski2016-11-031-1/+1
| | | | | |