Commit graph

58805 commits

Author SHA1 Message Date
P.I.E. Security Team
9b794f8e5e
Expose libsodium's Ristretto255 API (#6922) 2021-05-07 17:43:00 -05:00
Nikita Popov
ca8247654c Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix zip build
2021-05-07 22:42:50 +02:00
Nikita Popov
1c2e7b4ea0 Fix zip build 2021-05-07 22:42:31 +02:00
Christoph M. Becker
cc86f70de9
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80863: ZipArchive::extractTo() ignores references
2021-05-07 19:22:51 +02:00
Christoph M. Becker
ab3052ab26
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80863: ZipArchive::extractTo() ignores references
2021-05-07 19:21:58 +02:00
Christoph M. Becker
57918b1a1b
Fix #80863: ZipArchive::extractTo() ignores references
We need to cater to references, when traversing the files to extract.
While we're at it, we move the `zval_file` declaration into a narrower
scope.

Closes GH-6959.
2021-05-07 19:15:29 +02:00
Nikita Popov
32b107e6a6 Use smart_str_extend() instead of smart_str_alloc()
These usages were re-implementing the exact functionality of
smart_str_extend().
2021-05-07 16:42:17 +02:00
Nikita Popov
072c50fc77 Merge branch 'PHP-8.0'
* PHP-8.0:
  Update msan job to Ubuntu 20.04
  Skip some tests under msan
2021-05-07 16:28:57 +02:00
Nikita Popov
af948ae24c Skip some tests under msan
These test functions which don't have msan interceptors. This
results in false positives running msan on ubuntu 20.04.
2021-05-07 16:26:49 +02:00
Máté Kocsis
4ece535f19
Merge branch 'PHP-8.0'
* Fix return type of php_user_filter::onCreate()
* Fix return type of mysqli::init()
* Fix return type of UConverter::fromUCallback() and UConverter::toUCallback()
2021-05-07 15:23:28 +02:00
Máté Kocsis
54e2ef0b81
Fix return type of UConverter::fromUCallback() and UConverter::toUCallback()
Closes GH-6950
2021-05-07 15:21:58 +02:00
Máté Kocsis
e8361eb0e3
Fix return type of mysqli::init() 2021-05-07 15:21:41 +02:00
Máté Kocsis
a3c38c2596
Fix return type of php_user_filter::onCreate() 2021-05-07 15:21:11 +02:00
Nikita Popov
4baf340c39 Merge branch 'PHP-8.0'
* PHP-8.0:
  Remove getservbyname() variation tests
  Use SOL_TCP instead of getprotobyname() in tests
2021-05-07 14:56:13 +02:00
Nikita Popov
12118d592a Remove getservbyname() variation tests
These are zpp variations, which we no longer test.
2021-05-07 14:55:27 +02:00
Nikita Popov
0413cf3c20 Use SOL_TCP instead of getprotobyname() in tests
This is more idiomatic anyway, and works on msan, which misses
interceptors for getprotobyname().
2021-05-07 14:55:18 +02:00
Nikita Popov
50b4a7adf9 Property handle unset name on ReflectionClassConstant
While the typed property ensures that the value is a string,
we should make sure that we handle an unset property gracefully.

Do this by throwing the same error we would normally throw if
you access an uninitializde typed property.
2021-05-07 12:39:17 +02:00
Nikita Popov
26860c6b6a Fix -Wmaybe-uninitialized warning in intl uchar
This variable can indeed be uninitialized when passed to convert_cp,
though it will not actually be used if uninitialized. This is
still UB though, so let's fix it.
2021-05-07 12:20:16 +02:00
George Peter Banyard
c757c61a8c
Remove unnecessary error handler replacement in SPL
Document why it is needed in the remaining cases
Drive-by refactoring

Closes GH-6955
2021-05-07 11:17:56 +01:00
Nikita Popov
9eb295fc4c Fix -Wreturn-local-addr warning
zend_string_dup() can return the original string if it is interned.
Of course, the string can't be interned here, but GCC doesn't know
that and throws a warning in release builds.

Replace zend_string_dup() (which is a bad API anyway) with a direct
call to zend_string_init(), which makes it more obvious that the
original alloca'd string cannot be reused.
2021-05-07 12:11:52 +02:00
George Peter Banyard
2f1d0f2bc3
Throw directly instead of replacing error handler in ext/date (#6954) 2021-05-07 11:10:39 +01:00
Nikita Popov
91dc10c906 Store SplFileObject open_mode as zend_string 2021-05-07 11:23:05 +02:00
Nikita Popov
9602db3b4a Fix open_mode for SplTempFileObject
open_mode was initialized to "wb", but the length set only to 1.
The effect of this was that the stream is opened using "wb", but
we only report "w".

Fix the length to report the actually used open_mode.
2021-05-07 11:18:51 +02:00
Nikita Popov
3b3f6de782 Use zend_string_concat3 in one place
A bit nicer than snprintf + passing the same length around three
times.
2021-05-07 10:43:40 +02:00
Calvin Buckley
207666ee84
Implement server type/version for PDO_ODBC getAttr (#6935)
As an example using the IBM Db2i ODBC driver:

    PDO::ATTR_SERVER_INFO: DB2/400 SQL
    PDO::ATTR_SERVER_VERSION: 07.02.0015
2021-05-06 20:15:13 -05:00
George Peter Banyard
2cd5a200f5
Refactor php_date_initialize_from_hash()
Use early returns
Formalize return type to bool
2021-05-06 21:48:52 +01:00
K
efe79e0de6
Simplify unpack logic (#6908)
- move endiannes check to compile time
- remove php_unpack function
- the compiler take care of sign extension
2021-05-06 15:20:05 +02:00
Christoph M. Becker
66ad7095b0
Merge branch 'PHP-8.0'
* PHP-8.0:
  Add simple Firebird payload fake server to test suite
2021-05-06 14:51:02 +02:00
Christoph M. Becker
fb2bf8bd58
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Add simple Firebird payload fake server to test suite
2021-05-06 14:50:22 +02:00
Christoph M. Becker
f95f8a3c1e
Add simple Firebird payload fake server to test suite
This is meant to test against certain fixed responses of Firebird
servers.  For now we add just a most basic test which verifies a
connection attempt.

Closes GH-6940.
2021-05-06 14:47:57 +02:00
Nikita Popov
9ff8d362b3 Merge branch 'PHP-8.0'
* PHP-8.0:
  opcache: more reliable way to get the current binary on solaris/illumos
2021-05-06 14:34:28 +02:00
David Carlier
d87d2f006c opcache: more reliable way to get the current binary on solaris/illumos
Closes GH-6920.
2021-05-06 14:33:53 +02:00
Remi Collet
f9547f2b47
get rid of inet_aton and inet_ntoa use inet_ntop iand inet_pton where available standardize buffer size 2021-05-06 13:39:58 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Nikita Popov
13467bdcc0 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #81015
2021-05-06 10:47:22 +02:00
Nikita Popov
dd3e56ba24 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #81015
2021-05-06 10:46:30 +02:00
Nikita Popov
178bbe3478 Fixed bug #81015
Make sure that the previous opline is part of the same block,
otherwise it may be non-dominating.

The test case does not fail on PHP-7.4, but I think the general
problem can appear on 7.4 as well, so I'm applying the patch to
that branch.
2021-05-06 10:46:00 +02:00
Nikita Popov
bf9dc53435 Fixed bug #81007
Backport a change from the master branch. We usually test 32-bit
using -m32 from an x86-64 host, probably nobody tried using an
actual 32-bit host.
2021-05-05 16:53:43 +02:00
Máté Kocsis
7df7867624
Merge branch 'PHP-8.0'
* Fix the signature of PDOStatement::fetchObject()
2021-05-05 16:51:23 +02:00
Máté Kocsis
068c8db276
Fix the signature of PDOStatement::fetchObject()
The ?array $ctorArgs = null parameter is changed to array $constructorArgs = [], and an additional memory leak revealed by the new test case is fixed.

Closes GH-6937

Co-Authored-By: Nikita Popov <nikita.ppv@gmail.com>
2021-05-05 16:48:22 +02:00
Christoph M. Becker
9e51b487f3
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Add CONFLICTS file for PDO firebird tests
2021-05-05 15:24:58 +02:00
Nikita Popov
896e4d3428
Add CONFLICTS file for PDO firebird tests
Just in case anybody executes these test in parallel on PHP 7.4.

(cherry picked from commit b4ffe54174)

Closes GH-6943.
2021-05-05 15:24:30 +02:00
George Peter Banyard
27d40da95d Convert IMAPConnection to IMAP\Connection 2021-05-05 14:22:43 +01:00
Nikita Popov
c15dc63ad2 Merge branch 'PHP-8.0'
* PHP-8.0:
  openssl_pkcs7_read: input is data not filename
2021-05-05 09:50:11 +02:00
Vincent JARDIN
bb0107b63d openssl_pkcs7_read: input is data not filename
The argument should be an input string and not a filename.

Fix: https://github.com/php/doc-en/pull/559
Suggested-by: George Peter Banyard <girgias@php.net>

Closes GH-6942.
2021-05-05 09:49:53 +02:00
Christoph M. Becker
592cfa309e
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #81011: mb_convert_encoding removes references from arrays
2021-05-04 18:40:23 +02:00
Christoph M. Becker
d1c0cbdcb1
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81011: mb_convert_encoding removes references from arrays
2021-05-04 18:39:39 +02:00
Christoph M. Becker
0cafd53d18
Fix #81011: mb_convert_encoding removes references from arrays
We need to dereference references.

Closes GH-6938.
2021-05-04 18:37:40 +02:00
Nikita Popov
31c74aaeeb Use EXTENSIONS instead of SKIPIF section 2021-05-03 18:37:42 +02:00
Christoph M. Becker
895185e5ea
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #79100: Wrong FTP error messages
2021-05-03 15:25:17 +02:00