Commit graph

467 commits

Author SHA1 Message Date
Máté Kocsis
9493893412 Cleanup return values when parameter parsing is unsuccessful 2019-10-30 16:05:20 +01:00
Christoph M. Becker
ecc9588d0c Properly handle non resources passed to socket_select()
As of PHP 8.0.0, failing `zend_fetch_resource_ex()` throws a TypeError,
so we cannot simply skip non resources in the `$read`, `$write` and
`$except` arrays.  Instead we bail out.  Since these arrays are already
checked in `php_sock_array_to_fd_set()`, we remove the additional check
in `php_sock_array_from_fd_set()`.
2019-10-18 14:16:25 +02:00
Christoph M. Becker
77bd1ce60d Just return after exception has been thrown 2019-10-12 23:09:23 +02:00
Thomas Gerbet
428bd3d908 Add stubs for ext-sockets 2019-10-12 17:08:24 +02:00
Christoph M. Becker
642f80636e Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix potential heap corruption
2019-10-12 16:16:44 +02:00
Christoph M. Becker
c10d3d3a35 Fix potential heap corruption
`tmp` is allocated by `malloc()`, so we must not `LocalFree()` it.
2019-10-12 16:16:14 +02:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
viest
48040cf345 Remove deprecated getaddrinfo flags
The AI_IDN_ALLOW_UNASSIGNED and AI_IDN_USE_STD3_ASCII_RULES have
been deprecated by glibcs, and PHP 7.4 follows this deprecation.

This removes the offending flags for PHP 8.0.
2019-08-26 11:45:31 +02:00
viest
5703943081 Deprecate AI_IDN_ALLOW_UNASSIGNED and AI_IDN_USE_STD3_ASCII_RULES
These flags have been deprecated in glibc 2.28, so we also
deprecate them in PHP.

As we can't deprecate constants, we can only check for their use
in socket_addrinfo_lookup().
2019-08-26 11:33:18 +02:00
Nikita Popov
fc8fb77262 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-23 11:13:14 +02:00
Nikita Popov
b394654c1e Merge branch 'PHP-7.2' into PHP-7.3 2019-05-23 11:12:59 +02:00
Nikita Popov
9a74b23297 Fixed bug #78038 socket_select with references 2019-05-23 11:12:15 +02:00
Dmitry Stogov
e188e4170f Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:28:29 +03:00
David Carlier
4e87e56e22 Adding bunch of FreeBSD socket options flags specifics.
SO_USER_COOKIE primarly to be traced via dtrace instrumentation.
If SO_USER_COOKIE is available, the rest is so the former is
two years old while the rest is from around 2008.
2019-02-12 10:27:33 +01:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Nikita Popov
e219ec144e Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2

This is a squash of PR #3734, which is a squash of PR #3313.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2019-01-11 15:49:06 +01:00
Anatol Belski
8789348364 Merge branch 'PHP-7.3'
* PHP-7.3:
  Initialize s_un (sockaddr_un) to zero before using it. Fixes #76839.
2018-12-26 19:03:04 +01:00
Anatol Belski
e38e44e3c6 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Initialize s_un (sockaddr_un) to zero before using it. Fixes #76839.
2018-12-26 19:01:36 +01:00
Michael Meyer
3c42c784c2 Initialize s_un (sockaddr_un) to zero before using it. Fixes #76839. 2018-12-26 18:58:27 +01:00
Joe Watkins
177d45b7e7
Merge branch 'PHP-7.3'
* PHP-7.3:
  Validate length on socket_write
2018-11-13 13:00:50 +01:00
Joe Watkins
8a11c9ee76
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Validate length on socket_write
2018-11-13 13:00:08 +01:00
Joe Watkins
ce4eb89976
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Validate length on socket_write
2018-11-13 12:58:23 +01:00
Thiago Carvalho
ec2e7a2d48
Validate length on socket_write 2018-11-13 12:56:37 +01:00
Anatol Belski
321c0cc349 Fix localized error messages and memory leaks
The FormatMessage API needs to LocalFree the delivered error messages.
In cases where messages are delivered in non ASCII compatible encoding,
the messages might be unreadable. This aligns the error message encoding
with the encoding settings in PHP, the focus is UTF-8 as default.

Initialize error buffer

Avoid code duplication
2018-09-17 10:56:50 +02:00
Anatol Belski
9d7c510893 Cleanup unused items 2018-08-02 18:28:56 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Anatol Belski
9d4da80e90 Implemented winsock info import/export 2018-05-17 11:36:23 +02:00
Dmitry Stogov
524f5245c5 Avoid useless checks, using zend_string_efree(), in cases where the string is known to be a temporary allocated zend_string. 2018-05-08 17:30:15 +03:00
Thomas Punt
74ecbbebe5 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix potential memory leaks in sockets extension
2018-04-28 13:58:45 +01:00
Thomas Punt
d990b9316a Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix potential memory leaks in sockets extension
2018-04-28 13:57:30 +01:00
Thomas Punt
643c9c9b47 Fix potential memory leaks in sockets extension 2018-04-28 13:55:24 +01:00
Nikita Popov
bd2ecb01d2 Merge branch 'PHP-7.2' 2018-03-11 16:37:08 +01:00
Thomas Petazzoni
8489ecefd3 ext/sockets: make AI_IDN usage optional
AI_IDN is not supported by all C libraries (uClibc, musl), so make it
optional, like AI_ALL.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-03-11 16:35:17 +01:00
Anatol Belski
b9040b812c Merge branch 'PHP-7.2'
* PHP-7.2:
  Remove TSRMLS_*
2018-03-01 12:15:20 +01:00
Anatol Belski
3c58b2c31a Remove TSRMLS_* 2018-03-01 12:12:11 +01:00
Thomas Punt
e51aadcc4e Merge branch 'PHP-7.2'
* PHP-7.2:
  Use the correct freeing function
2018-01-29 11:17:23 +00:00
Thomas Punt
0f393a6102 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Use the correct freeing function
2018-01-29 11:13:22 +00:00
Thomas Punt
fb128f6512 Use the correct freeing function 2018-01-29 11:13:10 +00:00
Dmitry Stogov
67e47c3ee3 Eliminate useless separations 2018-01-17 12:45:23 +03:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Dmitry Stogov
6a9d2b2190 Cleanup type conversion 2017-12-07 19:24:55 +03:00
Sara Golemon
ec90310ea9 Guard against AI_NUMERICSERV not being defined. 2017-10-01 21:37:04 -04:00
Sara Golemon
320c4f22a4
Guard against AI_NUMERICSERV not being defined. 2017-10-01 21:32:31 -04:00
David Carlier
93d7cf375e Fix openbsd build: AI_V4MAPPED, AI_ALL not defined 2017-03-27 18:55:34 +02:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00