summaryrefslogtreecommitdiff
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* Fix HTTP response status codeChristoph M. Becker2020-08-181-1/+1
|
* Null terminate the sodium_crypto_kx_keypair() resultNikita Popov2020-08-141-0/+1
|
* Fix #64705 errorInfo property of PDOException is null when ↵Ahmed Abdou2020-08-118-6/+82
| | | | | | | | | PDO::__construct() fails PDO driver constructors are throwing PdoException without setting errorInfo, so create a new reusable function that throws exceptions for PDO and will also set the errorInfo. Use this function in pdo_mysql, pdo_sqlite, and pdo_pgsql.
* Fix bug #75785 by attempt switching endianness on Maker's NoteNawarian2020-08-113-10/+35
| | | | | | | | | | Different manufacturer models may come with a different endianness (motorola/intel) format. In order to avoid a big refactor and a gigantic lookup table, this commit simply attempts to switch the endianness and proceed when values are acceptable. Closes GH-5849.
* Fix #48585: com_load_typelib holds reference, fails on second callChristoph M. Becker2020-08-112-7/+3
| | | | | | | | Whether the type library is cached is actually irrelevant here; what matters is that the symbols are imported, and since these are not cached, we have to import them for every request. And we cannot cache the symbols, because the import depends on the current codepage, but the codepage is a `PHP_INI_ALL` setting.
* Fixed bug #79951Nikita Popov2020-08-112-10/+16
| | | | | | One branch did not release tmp_replace_entry_str. Also reduce the scope of some variables.
* Check the correct listNikita Popov2020-08-101-1/+1
| | | | This was supposed to check mx_list, not weight_list... oops.
* Fix bug #79944Nikita Popov2020-08-102-10/+14
| | | | Only return true from dns_get_mx if we actually found any MX record.
* Fix #79922: Crash after multiple calls to xml_parser_free()Christoph M. Becker2020-08-102-2/+19
| | | | | | | | | | | | | | | | | | | | | We must not call `zend_list_delete()` in resource closer functions exposed to userland, because decreasing the refcount there leads to use-after-free scenarios. In this case, commit 4a42fbb worked for typical use-cases where `xml_parser_free()` has been called exactly once for the resource, because there is an internal zval (`->index`) referencing the same resource which already increased the refcount by one. However, when `xml_parser_free()` is called multiple times on the same XML parser resource, the resource would be freed prematurely. Instead we forcefully close the resource in `xml_parser_free()`. We also could decrease the refcount of the resource there, but that would require to call `xml_parser_free()` which is somewhat uncommon, and would be particularly bad wrt. PHP 8 where that function is a NOP, and as such doesn't have to be called. So we do no longer increase the refcount of the resource when copying it to the internal zval, and let the usualy refcounting semantics take care of the resource destruction. [1] <http://git.php.net/?p=php-src.git;a=commit;h=4a42fbbbc73aad7427aef5c89974d1833636e082>
* Fix bug #70574: Move files to proper locale dirFlorian Engelhardt2020-08-0717-0/+0
| | | | Closes GH-5940.
* Fix memory leak on socket_sendmsg() / socket_recvmsg() errorNikita Popov2020-08-052-8/+22
|
* Fixed bug #79930Nikita Popov2020-08-052-1/+34
| | | | We're inserting src_zval, so that's what we should addref.
* Fix iov_base pointer type for illumosDavid Carlier2020-08-051-1/+1
| | | | | | | These systems has two versions of the iovec interface dependent on compiler flags passed, the legacy version causing little build issue. Closes GH-5939.
* Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2020-08-025-1/+29
|\ | | | | | | | | | | * PHP-7.2: Fix #79877: getimagesize function silently truncates after a null byte Fix #79797: Use of freed hash key in the phar_parse_zipfile function
| * Fix #79877: getimagesize function silently truncates after a null byteChristoph M. Becker2020-08-022-0/+14
| | | | | | | | We have to check for NUL bytes if `getimagesize()` has been called.
| * Fix #79797: Use of freed hash key in the phar_parse_zipfile functionChristoph M. Becker2020-08-023-1/+15
| | | | | | | | We must not use heap memory after we freed it.
| * Update CREDITS for PHP 7.2.30Sara Golemon2020-04-142-11/+11
| |
| * Fixed bug #79468dinosaur2020-04-141-0/+21
| | | | | | | | Close the stream filter resources when removing them from the stream.
* | Amendment to OPcache base file removalChristoph M. Becker2020-07-291-3/+2
| | | | | | | | | | We fix the erroneous segment size. We also keep the segment pointer at the allocated address, but increase the position instead.
* | Consider op1 literal of FETCH_OBJ_RNikita Popov2020-07-291-0/+3
| | | | | | | | | | | | FETCH_OBJ_R may have an op1 CONST operand, even though it will always error. We should take this into account when compacting literals.
* | Fix testNikita Popov2020-07-291-1/+1
| |
* | Handle bindto errortwosee2020-07-291-0/+16
| | | | | | | | Closes GH-5903.
* | Fix #73060: php failed with error after temp folder cleaned upChristoph M. Becker2020-07-291-62/+12
| | | | | | | | | | | | Instead of storing the mapping base address and the address of `execute_ex()` in a separate file in the temporary folder, we store them right at the beginning of the memory mapping.
* | Fix #79806: realpath() erroneously resolves link to linkChristoph M. Becker2020-07-281-6/+0
| | | | | | | | | | After resolving reparse points, the path still may be a reparse point; in that case we have to resolve that reparse point as well.
* | fix memory leaks in ext/ldap/ldap.cPaweł Tomulik2020-07-281-104/+98
| |
* | Revert "Fix #79806: realpath() erroneously resolves link to link"Christoph M. Becker2020-07-271-0/+6
| | | | | | | | This reverts commit d5b59b4303642adac91df2c93969a72bc0f5fa7d.
* | Fix #79806: realpath() erroneously resolves link to linkChristoph M. Becker2020-07-271-6/+0
| | | | | | | | | | After resolving reparse points, the path still may be a reparse point; in that case we have to resolve that reparse point as well.
* | Fix brittle testChristoph M. Becker2020-07-221-9/+4
| | | | | | | | | | | | This test fails occasionally due to timing issues, because the session file may have been unlinked by the first `session_start()`'s GC. We adapt the test expectation to this reality.
* | Fix #63527: DCOM does not work with Username, Password parameterChristoph M. Becker2020-07-201-1/+1
| | | | | | | | | | | | | | | | | | We must not mix multibyte and wide character strings in the `COAUTHIDENTITY` structure. Using wide character strings throughout would have the advantage that the remote connection can be established regardless of the code page of the server, but that would more likely break BC, so we just drop the wide character string conversion of the username.
* | Fix bug #78008: dns_check_record() always return true on AlpineAndy Postnikov2020-07-151-18/+14
| | | | | | | | | | | | | | | | - free handle before return result - cleaned up remaining usage of MAXPACKET - update dns_get_mx() to use the same approach Closes GH-5854.
* | Fixed bug #79849Evgeny Stepanischev2020-07-141-2/+3
| | | | | | | | Closes GH-5853.
* | Fixed BC break of php_debug_zval_dumptwosee2020-07-111-1/+1
| | | | | | | | It introduced by fixing bug #79830
* | Fixed bug #79830 introduced by fixing bug #79821twosee2020-07-112-25/+37
| | | | | | | | This also fixes memory error in debug_zval_dump and var_export.
* | Fixed bug #79821twosee2020-07-112-0/+24
| | | | | | | | | | | | HashTable was reallocated (zend_hash_packed_grow) during php_var_dump, so we should call GC_ADDREF to make SEPARATE_ARRAY work. Closes GH-5837.
* | Fixed bug #79817Nikita Popov2020-07-101-5/+5
| | | | | | | | Use *_IND macros in a few places in string.c.
* | Fix some memory bugs in ldap.cPaweł Tomulik2020-07-091-8/+38
| |
* | Fix bug #79787XXiang2020-07-082-5/+29
| | | | | | | | Closes GH-5807.
* | Report len as -1 instead of INT_MAXNikita Popov2020-07-082-2/+2
| | | | | | | | | | | | | | Per docs it should be -1. And would be on 32-bit systems, but not on 64-bit systems. (cherry picked from commit 39111585a2f8e40e72bdc662eb8b2e3c19e93615)
* | Fix #70362: Can't copy() large 'data://' with open_basedirChristoph M. Becker2020-06-302-1/+16
| | | | | | | | | | open_basedir is only relevant for plain files, so there is no need to check it for other URL wrappers.
* | Fix #63208: BSTR to PHP string conversion not binary safeChristoph M. Becker2020-06-294-14/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A `BSTR` is similar to a `zend_string`; it stores the length of the string just before the actual string, and thus the string may contain NUL bytes. However, `php_com_olestring_to_string()` is supposed to deal with arbitrary `OLECHAR*`s which may not be `BSTR`s, so we introduce `php_com_bstr_to_string()` and use it for the only case where we actually have to deal with `BSTR`s which may contain NUL bytes. Contrary to `php_com_olestring_to_string()` we return a `zend_string`, so we can save the re-allocation when converting to a `zval`. We also cater to `php_com_string_to_olestring()` not being binary safe, with basically the same fix we did for `php_com_olestring_to_string()`.
* | Fix #79756: finfo_file crash (FILEINFO_MIME)Christoph M. Becker2020-06-292-0/+16
| | | | | | | | | | If `ctime` or `asctime` return `NULL`, we must not attempt to copy the buffer, but rather return `NULL` as well.
* | Fixed bug #79741Nikita Popov2020-06-262-2/+18
| |
* | Fix #55857: ftp_size on large filesChristoph M. Becker2020-06-231-1/+4
| | | | | | | | | | | | | | | | | | `atol()` returns a `long` which is not the same as `zend_long` on LLP64; we use `ZEND_ATOL()` instead. There is no need for a new test case, since filesize_large.phpt already tests for that behavior; unfortunately, the FTP test suite relies on `pcntl_fork()` and therefore cannot be run on Windows.
* | Fixed bug #79570Böszörményi Zoltán2020-06-191-0/+18
| | | | | | | | | | | | | | Use the same logic for getgrgid_r, getpwnam_r and getpwuid_r as for getgrnam_r in #75696 Closes GH-5740.
* | Fixed bug #79710Nikita Popov2020-06-192-2/+47
| | | | | | | | Make sure we don't use zresource after the stream has been destroyed.
* | Fix #79687: Sony picture - PHP Warning - Make, Model, MakerNotesChristoph M. Becker2020-06-133-3/+32
| | | | | | | | | | | | | | Even if the length of a maker note does not match our expectations (either because the maker note is corrupted, or because our expectations do not quite match reality), there is no need to let parsing fail; we can still go on parsing the other meta information.
* | Fix #79676: imagescale adds black border with IMG_BICUBICChristoph M. Becker2020-06-122-4/+35
| | | | | | | | | | We have to loop over all image pixels to avoid the black border. This is also done in external libgd in `_gdScaleOneAxis` and `_gdScalePass`.
* | Fix #62890: default_socket_timeout=-1 causes connection to timeoutChristoph M. Becker2020-06-092-2/+17
| | | | | | | | | | | | While unencrypted connections ignore negative timeouts, SSL/TLS connections did not special case that, and so always failed due to timeout.
* | Fix #74267: segfault with streams and invalid dataChristoph M. Becker2020-06-082-4/+29
| | | | | | | | | | | | | | | | | | | | | | If the current character is a line break character, it cannot be a tab or space character, so we would always fail with an invalid sequence error. Obviously, these `scan_stat == 4` conditions are meant to be exclusive. Furthermore, if `in_pp == NULL || in_left_p == NULL` is true, we hit a segfault if we are not returning right away. Obviously, the additional constraints don't make sense, so we remove them.
* | Fix #73527: Invalid memory access in php_filter_stripChristoph M. Becker2020-06-041-3/+3
| |