1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 19:23:22 +02:00
Commit Graph

57943 Commits

Author SHA1 Message Date
Anatol Belski 2cee1be6d1 hash: Use hrtime() in the bench script [ci skip]
Signed-off-by: Anatol Belski <ab@php.net>
2021-01-09 21:41:45 +01:00
Anatol Belski 23590f7c53 hash: Implement xxHash
The implementation bundles the xxHash v0.8.0 release and includes all the variants

- xxh32, 32-bit wide
- xxh64, 64-bit wide
- xxh3, 64-bit wide
- xxh128, 128-bit wide

An initial hash state can be passed through the options arrray. An additional
functionality not targeted in this implementation is the secret support in xxh3
and xxh128. That can be added at a later point.

The serialization for xxh3 and xxh128 should not be implemented, as the
state would contain the secret. Despite the xxHash is a non crypto
algorithm, the secret would be serialized as plain text which would be
insecure.

Closes GH-6524

Signed-off-by: Anatol Belski <ab@php.net>
2021-01-09 19:35:32 +01:00
Shivam Mathur c1391227da Fix pdo_oci - declare quotedlen in oci_driver.c
Closes GH-6590
2021-01-09 04:27:40 +00:00
George Peter Banyard b3c5b8cf24 Merge branch 'PHP-8.0'
* PHP-8.0:
  Rename ``zip_ent`` parameter to ``zip_entry`` for consistency
2021-01-08 22:32:19 +00:00
George Peter Banyard f40838eaaa Rename `zip_ent parameter to zip_entry` for consistency
All other functions use ``zip_entry``
2021-01-08 22:26:24 +00:00
Nikita Popov 8b2b8563ef Remove some unnecessary zend_delete_global_variable uses 2021-01-08 11:31:31 +01:00
Nikita Popov 792f8fb1b5 Switch name variable to zend_string 2021-01-07 15:53:47 +00:00
Nikita Popov 7aa00369b0 Switch bound_param_map to zend_string 2021-01-07 15:53:47 +00:00
Nikita Popov 1b31a76221 Remove freeq member 2021-01-07 15:53:47 +00:00
George Peter Banyard 848f7e0e07 Refactor PDO placeholder's quoted string to zend_string 2021-01-07 15:53:54 +00:00
George Peter Banyard 63cda0fea8 Refactor PDO's quoter handler to return a zend_string
Closes GH-6547
2021-01-07 15:53:48 +00:00
Tyson Andre df0fa5b178 Clean up remaining opcodes for foreach([] as $x)
Previously, two useless FE_RESET_R and FE_FREE would be left over whether the empty array
was from a literal, a variable, or a class constant.

This doesn't pick up the RESET_RW case due to a weakness in our "may throw"
modeling. (for foreach by reference).

Co-Authored-By: Nikita Popov <nikita.ppv@gmail.com>
using https://gist.github.com/nikic/58d367ad605e10299f5433d2d83a0b5b

Closes GH-4949
2021-01-07 09:43:31 -05:00
Nikita Popov 3460af5262 Fold dirname in sccp for non-windows platforms 2021-01-07 14:27:12 +01:00
Christoph M. Becker c5812389b8 Merge branch 'PHP-8.0'
* PHP-8.0:
  Avoid modifying the return value of readline_completion_function()
2021-01-07 13:49:02 +01:00
Christoph M. Becker 8ae02c8a95 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Avoid modifying the return value of readline_completion_function()
2021-01-07 13:48:17 +01:00
Christoph M. Becker 9450893dc6 Avoid modifying the return value of readline_completion_function()
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.
2021-01-07 13:46:09 +01:00
Nikita Popov 7b2c098f87 Merge branch 'PHP-8.0'
* PHP-8.0:
  Make fetch_* OO same as func
2021-01-06 15:03:28 +01:00
Dharman 34ef804b04 Make fetch_* OO same as func
Clsoses GH-6580.
2021-01-06 15:02:52 +01:00
Nikita Popov 63263abff8 Remove unnecessary INDIRECT checks in JIT helpers 2021-01-06 14:28:17 +01:00
Christoph M. Becker f4bff315bd Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80592: all floats are the same in ODBC parameters
2021-01-06 13:56:15 +01:00
Christoph M. Becker f674a3343c Fix #80592: all floats are the same in ODBC parameters
We must not release the strings until we are done with them.

Closes GH-6579.
2021-01-06 13:56:02 +01:00
Nikita Popov 26fc4bea44 Remove some INDIRECT handling in standard library 2021-01-06 12:46:31 +01:00
Nikita Popov 3c68f38fda Restrict allowed usages of $GLOBALS
This restricts allowed usage of $GLOBALS, with the effect that
plain PHP arrays can no longer contain INDIRECT elements.

RFC: https://wiki.php.net/rfc/restrict_globals_usage

Closes GH-6487.
2021-01-06 12:46:24 +01:00
Nikita Popov 73f989a83b Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix/improve mysqli stubs
2021-01-06 11:29:38 +01:00
Dharman 44a311dbbe Fix/improve mysqli stubs
* mysqli_commit $flags default value is 0, not -1.
* A number of functions cannot actually return null.
* mysqli_poll parameter names were incorrect, as this function
  has a different signature from select.
* fetch functions apart from fetch_all can return false on failure.
2021-01-06 11:28:45 +01:00
George Peter Banyard 1a58611ae5 Voidify PDO's fetch_error handler 2021-01-06 10:20:57 +00:00
George Peter Banyard 60a61afd3c Boolify PDO's preparer handler 2021-01-06 10:20:57 +00:00
George Peter Banyard 53ba72ec03 Voidify PDO's closer handler 2021-01-06 10:20:57 +00:00
George Peter Banyard 954d3743cc Boolify PDO's quoter handler 2021-01-06 10:21:06 +00:00
George Peter Banyard 43f69160cf Boolify PDO's set_attribute driver function 2021-01-06 10:20:59 +00:00
George Peter Banyard d04adf60be Boolify PDO's transaction handlers
This includes begin(), commit(), rollBack(), and inTransaction()
2021-01-06 10:20:57 +00:00
George Peter Banyard 6728c1bd72 Formalize pdo_dbh_check_liveness_func() return type to zend_result 2021-01-06 10:20:57 +00:00
George Peter Banyard ca5fcb83bf Add/expand comments for PDO handlers 2021-01-06 10:20:57 +00:00
George Peter Banyard 01c8fe8fc0 Convert strcmp() usage to zend_string_equals_literal() 2021-01-06 10:20:57 +00:00
Christoph M. Becker b4269664fa Merge branch 'PHP-8.0'
* PHP-8.0:
  Add missing SKIPIF clause for require_hash.phpt
2021-01-06 11:02:23 +01:00
Christoph M. Becker 90081c5391 Add missing SKIPIF clause for require_hash.phpt 2021-01-06 11:00:10 +01:00
Christoph M. Becker 555bd2f0ef Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #77565: Incorrect locator detection in ZIP-based phars
2021-01-05 23:46:46 +01:00
Christoph M. Becker 66a74f2f4a Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #77565: Incorrect locator detection in ZIP-based phars
2021-01-05 23:46:05 +01:00
Christoph M. Becker d1b1c04398 Fix #77565: Incorrect locator detection in ZIP-based phars
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.
2021-01-05 23:40:24 +01:00
Christoph M. Becker e9d5169b0b Merge branch 'PHP-8.0'
* PHP-8.0:
  Prevent double-free of Phar ZIP stream
2021-01-05 14:32:04 +01:00
Christoph M. Becker b7689db7ab Prevent double-free of Phar ZIP stream
We must not alias the closed stream to `phar_archive_data.fp`, and use
PHAR_ZIP_FAIL() for consistency with the rest of this function.

Closes GH-6578.
2021-01-05 14:31:43 +01:00
Christoph M. Becker 6fc0f8e933 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix memory leak in Phar::webPhar() on Windows
2021-01-05 14:27:14 +01:00
Christoph M. Becker afc69e46b8 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix memory leak in Phar::webPhar() on Windows
2021-01-05 14:25:44 +01:00
Christoph M. Becker 5c963731e2 Fix memory leak in Phar::webPhar() on Windows
Closes GH-6574.
2021-01-05 14:21:35 +01:00
Nikita Popov d29d3a4bf6 Fix use-after-scope in SplObjectStorage::unserialize()
Introduced by the recent switch to a zend_object. Unserialize the
object into a tmp_var to avoid leaving behind a stack reference.

Fixes oss-fuzz #29271.
2021-01-05 12:44:17 +01:00
George Peter Banyard 589bdf30b2 Implement Explicit octal notation for integers RFC
RFC: https://wiki.php.net/rfc/explicit_octal_notation

Add an extensive test suits for other variants of integer literals

Closes GH-6360
2021-01-04 21:09:23 +01:00
Nikita Popov ab9f497b90 Fix curl_getinfo() funcinfo
This can now return any type with any refcount.
2021-01-04 18:57:57 +01:00
George Peter Banyard af1b89f36c Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix bug #80584: 0x and 0X are considered valid hex numbers by filter_var()
2021-01-04 18:08:04 +01:00
George Peter Banyard 764b7bf108 Fix bug #80584: 0x and 0X are considered valid hex numbers by filter_var()
Closes GH-6573
2021-01-04 18:07:47 +01:00
Christoph M. Becker a8413902b1 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #76929: zip-based phar does not respect phar.require_hash
2021-01-04 17:49:07 +01:00