| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
One branch did not release tmp_replace_entry_str.
Also reduce the scope of some variables.
|
|
|
|
| |
This was supposed to check mx_list, not weight_list... oops.
|
|
|
|
| |
Only return true from dns_get_mx if we actually found any MX record.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Closes GH-5940.
|
| |
|
|
|
|
| |
We're inserting src_zval, so that's what we should addref.
|
|
|
|
|
|
|
| |
These systems has two versions of the iovec interface dependent on
compiler flags passed, the legacy version causing little build issue.
Closes GH-5939.
|
|\
| |
| |
| |
| |
| | |
* 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
|
| |
| |
| |
| | |
We have to check for NUL bytes if `getimagesize()` has been called.
|
| |
| |
| |
| | |
We must not use heap memory after we freed it.
|
| | |
|
| |
| |
| |
| | |
Close the stream filter resources when removing them from the stream.
|
| |
| |
| |
| |
| | |
We fix the erroneous segment size. We also keep the segment pointer at
the allocated address, but increase the position instead.
|
| |
| |
| |
| |
| |
| | |
FETCH_OBJ_R may have an op1 CONST operand, even though it will
always error. We should take this into account when compacting
literals.
|
| | |
|
| |
| |
| |
| | |
Closes GH-5903.
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
After resolving reparse points, the path still may be a reparse point;
in that case we have to resolve that reparse point as well.
|
| | |
|
| |
| |
| |
| | |
This reverts commit d5b59b4303642adac91df2c93969a72bc0f5fa7d.
|
| |
| |
| |
| |
| | |
After resolving reparse points, the path still may be a reparse point;
in that case we have to resolve that reparse point as well.
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| | |
- free handle before return result
- cleaned up remaining usage of MAXPACKET
- update dns_get_mx() to use the same approach
Closes GH-5854.
|
| |
| |
| |
| | |
Closes GH-5853.
|
| |
| |
| |
| | |
It introduced by fixing bug #79830
|
| |
| |
| |
| | |
This also fixes memory error in debug_zval_dump and var_export.
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
Use *_IND macros in a few places in string.c.
|
| | |
|
| |
| |
| |
| | |
Closes GH-5807.
|
| |
| |
| |
| |
| |
| |
| | |
Per docs it should be -1. And would be on 32-bit systems, but
not on 64-bit systems.
(cherry picked from commit 39111585a2f8e40e72bdc662eb8b2e3c19e93615)
|
| |
| |
| |
| |
| | |
open_basedir is only relevant for plain files, so there is no need to
check it for other URL wrappers.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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()`.
|
| |
| |
| |
| |
| | |
If `ctime` or `asctime` return `NULL`, we must not attempt to copy the
buffer, but rather return `NULL` as well.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`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.
|
| |
| |
| |
| |
| |
| |
| | |
Use the same logic for getgrgid_r, getpwnam_r and getpwuid_r
as for getgrnam_r in #75696
Closes GH-5740.
|
| |
| |
| |
| | |
Make sure we don't use zresource after the stream has been destroyed.
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
We have to loop over all image pixels to avoid the black border. This
is also done in external libgd in `_gdScaleOneAxis` and `_gdScalePass`.
|
| |
| |
| |
| |
| |
| | |
While unencrypted connections ignore negative timeouts, SSL/TLS
connections did not special case that, and so always failed due to
timeout.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|