summaryrefslogtreecommitdiff
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* Fix #78680: mysqlnd pam plugin missing terminating nullDaniel Black2021-02-152-7/+51
| | | | | | | | | | | | | | | | | | | The PAM service requires the terminating null to be part of the communication. Tested with MariaDB-10.4(pam) and Percona Server 5.7.32(auth_pam_compat). Also changed MySQL Enterprise test to the server side plugin, authentication_pam as opposed to the client plugin mysql_clear_password. Add additional check for pamtest user and pam service file as all are required for the test. More importantly, test result should actually succeed. Thanks Geoff Montee for bug report. Closes GH-78680.
* Fix leak when breaking out of FilesystemIteratorNikita Popov2021-02-152-19/+15
| | | | | | | | We need to always destroy current, not just when iter.data is not set. Take this opportunity to clean up the iterator destructor code a bit, to remove redundant checks and incorrect comments.
* Fixed bug #80719Nikita Popov2021-02-114-8/+23
|
* Fix locale dependent parsing of PostgreSQL version numberChristoph M. Becker2021-02-081-6/+9
| | | | | | | | | Version numbers are not supposed to be localized, so we must not apply locale dependent parsing with `atof()`. Using `php_version_compare()` might even be better. Closes GH-6668.
* Fix #80706: mail(): Headers after Bcc headers may be ignoredChristoph M. Becker2021-02-081-0/+76
| | | | | | | | We need to handle the case where a CRLF after a Bcc header is not the beginning of a folding marker, because in that case the Bcc header was not the last "thing". Closes GH-6666.
* Use ST_Y() instead of the deprecated/removed Y() in testChristoph M. Becker2021-02-051-2/+2
|
* Fix #74779: x() and y() truncating floats to integersChristoph M. Becker2021-02-052-1/+43
| | | | | | | | We must not use the locale dependent `atof()`, but instead use the (hopefully) locale independent `zend_strtod()`, when converting string representations of floating point numbers which are sent by the server. Closes GH-6665.
* Try SIGTERM before SIGKILL in opcache restartNikita Popov2021-02-041-2/+5
| | | | | | | SIGTERM is subject to HANDLE_BLOCK_INTERRUPTIONS(), which will allow code to exit critical sections before it gets terminated. Closes GH-6493.
* Fix #53467: Phar cannot compress large archivesChristoph M. Becker2021-02-031-17/+41
| | | | | | | | | | | | | | | | | | | When Phars are flushed, a new temporary file is created for each entry which should be compressed, and the `compressed_filesize` is retrieved. Afterwards, the Phar manifest is written, and only after that the files are copied to the actual Phar. So for each such entry there is an open temp file, what easily exceeds the limit. Therefore, we use a single temporary file for all entries, and store the start offset in the otherwise unused `header_offset` member. We ensure that the `cfp` members are properly set to NULL even if flushing fails, to avoid use after free scenarios. This solution is based on a suggestion by @lserni[1]. Closes GH-6643. [1] <https://github.com/box-project/box2/issues/80#issuecomment-77147371>
* Update year to 2021Peter Kokot2021-02-022-2/+2
| | | | Closes GH-6636.
* Add missing derefs in CurlFileNikita Popov2021-02-021-0/+3
| | | | As pointed out on GH-6456.
* Fix persistent leak on load_wsdl_ex failureNikita Popov2021-02-021-2/+1
| | | | | | Move the load_wsdl_ex call into the zend_try that destroys the docs hash table. The wsdl will be inserted into docs early on, and will thus be released on subsequent bailout.
* Fix #80654: file_get_contents() maxlen fails above (2**31)-1 bytesChristoph M. Becker2021-02-012-8/+0
| | | | | | | | | We remove the arbitrary restriction to `INT_MAX`; it is superfluous on 32bit systems where `ZEND_LONG_MAX == INT_MAX` anyway, and not useful on 64bit systems, where larger files should be readable, if the `memory_limit` is large enough. Closes GH-6648.
* Fix buildNikita Popov2021-02-011-1/+1
|
* Merge branch 'PHP-7.3' into PHP-7.4Stanislav Malyshev2021-01-314-14/+37
|\ | | | | | | | | * PHP-7.3: Fix bug #80672 - Null Dereference in SoapClient
| * Fix bug #80672 - Null Dereference in SoapClientStanislav Malyshev2021-01-314-14/+37
| |
* | Fix #80682 opcache doesn't honour pcre.jit optionRemi Collet2021-01-281-4/+6
| |
* | Merge branch 'PHP-7.3' into PHP-7.4Stanislav Malyshev2021-01-271-16/+0
|\ \ | |/ | | | | | | * PHP-7.3: Rm unneeded function
| * Rm unneeded functionStanislav Malyshev2021-01-271-16/+0
| |
* | Merge branch 'PHP-7.3' into PHP-7.4Stanislav Malyshev2021-01-268-28/+38
|\ \ | |/ | | | | | | * PHP-7.3: Alternative fix for bug 77423
| * Alternative fix for bug 77423Christoph M. Becker2021-01-268-28/+38
| | | | | | | | | | | | | | | | | | | | | | That bug report originally was about `parse_url()` misbehaving, but the security aspect was actually only regarding `FILTER_VALIDATE_URL`. Since the changes to `parse_url_ex()` apparently affect userland code which is relying on the sloppy URL parsing[1], this alternative restores the old parsing behavior, but ensures that the userinfo is checked for correctness for `FILTER_VALIDATE_URL`. [1] <https://github.com/php/php-src/commit/5174de7cd33c3d4fa591c9c93859ff9989b07e8c#commitcomment-45967652>
| * Updated to version 2021.1 (2021a)Derick Rethans2021-01-251-2360/+2559
| |
* | Fix #70091: Phar does not mark UTF-8 filenames in ZIP archivesChristoph M. Becker2021-01-262-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default encoding of filenames in a ZIP archive is IBM Code Page 437. Phar, however, only supports UTF-8 filenames. Therefore we have to mark filenames as being stored in UTF-8 by setting the general purpose bit 11 (the language encoding flag). The effect of not setting this bit for non ASCII filenames can be seen in popular tools like 7-Zip and UnZip, but not when extracting the archives via ext/phar (which is agnostic to the filename encoding), or via ext/zip (which guesses the encoding). Thus we add a somewhat brittle low-level test case. Closes GH-6630.
* | Fix #75850: Unclear error message wrt. __halt_compiler() w/o semicolonChristoph M. Becker2021-01-252-2/+2
| | | | | | | | | | | | We add the failure reason to the error message. Closes GH-6638.
* | Updated to version 2021.1 (2021a)Derick Rethans2021-01-251-2360/+2559
| |
* | Add missing SKIPIF clause for recently introduced test caseChristoph M. Becker2021-01-211-0/+1
| |
* | Fix #80648: Fix for bug 79296 should be based on runtime versionChristoph M. Becker2021-01-201-5/+6
| | | | | | | | | | | | | | Instead of checking for actually affected libzip versions, we now always `ZIP_TRUNCATE` empty files unless `ZIP_RDONLY` is set. Closes GH-6625.
* | Add missing SKIPIF clauses to new test casesChristoph M. Becker2021-01-202-0/+2
| |
* | Fixed bug #42560sj-i2021-01-192-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | Check open_basedir after the fallback to the system's temporary directory in tempnam(). In order to preserve the current behavior of upload_tmp_dir (do not check explicitly specified dir, but check fallback), new flags are added to check open_basedir for explicit dir and for fallback. Closes GH-6526.
* | Fix #69279: Compressed ZIP Phar extractTo() creates garbage filesChristoph M. Becker2021-01-195-1/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When extracting compressed files from an uncompressed Phar, we must not use the direct file pointer, but rather get an uncompressed file pointer. We also add a test to show that deflated and stored entries are properly extracted. This also fixes #79912, which appears to be a duplicate of #69279. Co-authored-by: Anna Filina <afilina@gmail.com> Closes GH-6599.
* | Fix #80595: Resetting POSTFIELDS to empty array breaks requestChristoph M. Becker2021-01-183-2/+40
| | | | | | | | | | | | | | | | | | | | | | | | This is mainly to work around https://github.com/curl/curl/issues/6455, but not building the mime structure for empty hashtables is a general performance optimization, so we do not restrict it to affected cURL versions (7.56.0 to 7.75.0). The minor change to bug79033.phpt is unexpected, but should not matter in practice. Closes GH-6606.
* | Avoid modifying the return value of readline_completion_function()Christoph M. Becker2021-01-071-0/+1
| | | | | | | | | | | | | | | | | | The internal function `_readline_command_generator()` modifies the internal array pointer of `readline_completion_function()`'s return value. We therefore separate the array, what also avoids failing assertions regarding the array refcount. Closes GH-6582.
* | Fix #77565: Incorrect locator detection in ZIP-based pharsChristoph M. Becker2021-01-055-40/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We must not assume that the first end of central dir signature in a ZIP archive actually designates the end of central directory record, since the data in the archive may contain arbitrary byte patterns. Thus, we better search from the end of the data, what is also slightly more efficient. There is, however, no way to detect the end of central directory signature by searching from the end of the ZIP archive with absolute certainty, since the signature could be part of the trailing comment. To mitigate, we check that the comment length fits to the found position, but that might still not be the correct position in rare cases. Closes GH-6507.
* | Fix memory leak in Phar::webPhar() on WindowsChristoph M. Becker2021-01-051-19/+17
| | | | | | | | Closes GH-6574.
* | Merge branch 'PHP-7.3' into PHP-7.4Stanislav Malyshev2021-01-017-15/+61
|\ \ | |/ | | | | | | * PHP-7.3: Fix #77423: parse_url() will deliver a wrong host to user
| * Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2021-01-017-15/+61
| |\ | | | | | | | | | | | | * PHP-7.2: Fix #77423: parse_url() will deliver a wrong host to user
| | * Fix #77423: parse_url() will deliver a wrong host to userPHP-7.2Christoph M. Becker2021-01-017-14/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid that `parse_url()` returns an erroneous host, which would be valid for `FILTER_VALIDATE_URL`, we make sure that only userinfo which is valid according to RFC 3986 is treated as such. For consistency with the existing url parsing code, we use ctype functions, although that is not necessarily correct.
* | | Replace sort() function calls with ksort() in basic ksort testhaszi2020-12-271-27/+27
| | | | | | | | | | | | Closes GH-6541.
* | | Fix #80384: limit read buffer sizeAdam Seitz2020-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case of a stream with no filters, php_stream_fill_read_buffer only reads stream->chunk_size into the read buffer. If the stream has filters attached, it could unnecessarily buffer a large amount of data. With this change, php_stream_fill_read_buffer only proceeds until either the requested size or stream->chunk_size is available in the read buffer. Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de> Closes GH-6444.
* | | Fixed bug #80376 (last day of the month causes runway cpu usage)Derick Rethans2020-12-212-16889/+19644
| | |
* | | MySQLnd: Support cursors in store/get resultNikita Popov2020-12-184-92/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes two related issues: 1. When a PS with cursor is used in store_result/get_result, perform a COM_FETCH with maximum number of rows rather than silently switching to an unbuffered result set (in the case of store_result) or erroring (in the case of get_result). In the future, we might want to make get_result unbuffered for PS with cursors, as using cursors with buffered result sets doesn't really make sense. Unlike store_result, get_result isn't very explicit about what kind of result set is desired. 2. If the client did not request a cursor, but the server reports that a cursor exists, ignore this and treat the PS as if it has no cursor (i.e. to not use COM_FETCH). It appears to be a server side bug that a cursor used inside an SP will be reported to the client, even though the client cannot use the cursor. Fixes bug #64638, bug #72862, bug #77935. Closes GH-6518.
* | | Fixed bug #67983Nikita Popov2020-12-162-22/+58
| | | | | | | | | | | | | | | We need to check the BIT case first, otherwise it will get skipped in INT_AND_FLOAT_NATIVE mode.
* | | Fix #77322: PharData::addEmptyDir('/') Possible integer overflowChristoph M. Becker2020-12-152-1/+25
| | | | | | | | | | | | | | | | | | | | | `phar_path_check()` already strips a leading slash, so we must not attempt to strip the trailing slash from an now empty directory name. Closes GH-6508.
* | | Drop pdo_mysql_prepare_load_data.phptChristoph M. Becker2020-12-141-129/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like the test title and some comments in this test describe, this test was supposed to have `::prepare()` failing because `LOAD DATA INFILE` would not be supported as prepared statement, and then the test checks whether follow-up queries would succeed. However, `LOAD DATA INFILE` is supported for prepared statements at least on Windows with mysqlnd, so the test does no longer test what it is supposed to do. Therefore, we drop it. Closes GH-6509.
* | | Fixed bug #76815Nikita Popov2020-12-102-0/+40
| | | | | | | | | | | | | | | | | | When we receive an error while reading a result set, we should assume that no more result sets are available. libmysqlclient implements the same behavior.
* | | Fixed bug #71145Nikita Popov2020-12-102-5/+32
| | | | | | | | | | | | Consume any additional result sets when running INIT_COMMAND.
* | | Backport fix for bug #70066Nikita Popov2020-12-104-11/+35
| | | | | | | | | | | | | | | | | | | | | Given the number of duplicates this bug report had, it seems worthwhile to fix this on PHP-7.4 as well. Cherry-pick of 106e7e4bca7c0fd975eb219b18e3c34957ba8657.
* | | Fixed bug #78154Nikita Popov2020-12-092-1/+35
| | | | | | | | | | | | Handle errors during next_result in exec.
* | | Fix #48725: Support for flushing in zlib streamChristoph M. Becker2020-12-082-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `php_zlib_deflate_filter()` is called with `PSFS_FLAG_FLUSH_INC` but without new buckets being available (e.g. because a user calls `rewind()` after writing to the stream), we have to make sure that any pending data are flushed. This could basically be done like in the attached patch[1], but that could cause unnessary flushes, which can be harmful for compression, and adds unnecessary flush markers to the stream. Thus, we use the `php_zlib_filter_data.finished` field, which has not been used for `zlib.deflate` filters, and properly keep track of the need to flush. [1] <https://bugs.php.net/patch-display.php?bug_id=48725&patch=zlib-filter-flush-fix.patch&revision=latest> Closes GH-6019.
* | | Fix #77069: stream filter loses final block of dataChristoph M. Becker2020-12-085-1/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reading from a stream may return greater than zero, but nonetheless the stream's EOF flag may have been set. We have to cater to this condition by setting the close flag for filters. We also have to cater to that change in the zlib.inflate filter: If `inflate()` is called with flush mode `Z_FINISH`, but the output buffer is not large enough to inflate all available data, it fails with `Z_BUF_ERROR`. However, `Z_BUF_ERROR` is not fatal; in fact, the zlib manual states: "If deflate returns with Z_OK or Z_BUF_ERROR, this function must be called again with Z_FINISH and more output space (updated avail_out) but no more input data, until it returns with Z_STREAM_END or an error." Hence, we do so. Closes GH-6001.