1
0
mirror of https://github.com/php/php-src.git synced 2026-03-25 16:52:18 +01:00
Commit Graph

6241 Commits

Author SHA1 Message Date
Gina Peter Banyard
effd3f6212 main: Voidify php_startup_ticks() (#17479)
As it always returns SUCCESS and we ignored the return value anyway
2025-01-15 15:55:42 +00:00
Christoph M. Becker
1675d32261 Fix printf style issues in Windows specific code (GH-17452)
A couple of calls pass strings as formats (`-Wformat-security`), and
some others mix up types (`-Wformat`).
2025-01-13 11:50:05 +01:00
Tim Düsterhus
cee64ed3bd Add dedicated zend_ast_op_array struct (#17391)
Given that the `ZEND_AST_OP_ARRAY` type already needed special handling in
various places, it makes sense to give it its own struct to avoid some of the
casts. As a side benefit, it is a little smaller than the `zend_ast_zval`
struct.
2025-01-08 11:26:35 +01:00
Gina Peter Banyard
0fe3a91494 main/streams: Remove questionable use of PHP_STRLCPY
The description of PHP_STRLCPY says that this is a fast version of strlcpy that should be used if we *know* the size of both the source and destination buffers.
This is clearly not the case as we use strlen() to compute it.
Moreover if the result cannot fit in the destination buffer something seriously strange has happened and we should return a failure state rather than truncating.
2025-01-03 13:45:23 +00:00
Christoph M. Becker
4dc055506c Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17067: glob:// wrapper doesn't cater to CWD for ZTS builds
2024-12-18 13:04:41 +01:00
Christoph M. Becker
a8ffabfc91 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17067: glob:// wrapper doesn't cater to CWD for ZTS builds
2024-12-18 13:04:10 +01:00
Christoph M. Becker
53b69ba8cf Fix GH-17067: glob:// wrapper doesn't cater to CWD for ZTS builds
`glob(3)` doesn't know the virtual CWD of PHP, so we need to pass an
absolute path for ZTS builds.  In lack of a reusable routine, we copy
the code from `glob()` and adapt as needed.

Closes GH-17074.
2024-12-18 13:02:48 +01:00
Jakub Zelenka
b1e3dcf88a PHP-8.3 is now for PHP 8.3.16-dev 2024-12-03 18:45:43 +01:00
Calvin Buckley
f12cd1985e PHP-8.4 is now for PHP-8.4.3-dev 2024-12-03 11:27:18 -04:00
Niels Dossche
51aee3877b Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16998: UBSAN warning in rfc1867
2024-12-01 11:00:23 +01:00
Niels Dossche
c06a1a44f7 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16998: UBSAN warning in rfc1867
2024-12-01 11:00:17 +01:00
Niels Dossche
4eaa6f9d4e Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16998: UBSAN warning in rfc1867
2024-12-01 10:59:59 +01:00
Niels Dossche
aab784263d Fix GH-16998: UBSAN warning in rfc1867
The "else branch" of `next_line` can reset the `buf_begin` field to
NULL, causing the next invocation to pass NULL to `memchr` with a 0
length. When UBSAN is enabled this causes an UBSAN abort. Real world
impact is likely none because of the 0 length.

To fix this, don't set the pointer to NULL, which means that the
`memchr` will return NULL and since
`self->bytes_in_buffer < self->bufsize` we return NULL and request more
data through `fill_buffer`. That function will reset `buf_begin` and
`bytes_in_buffer` so that the next invocation works fine.

I chose this solution so we have an invariant that `buf_begin` is never
NULL, which makes reasoning easier. An alternative solution is keeping
the NULLing of `buf_begin` and add an extra check at the top of
`next_line`, but I didn't like special casing this.

Closes GH-17000.
2024-12-01 10:59:30 +01:00
Jakub Zelenka
284c4e3e31 Merge branch 'PHP-8.4' 2024-11-29 08:07:32 +01:00
Jakub Zelenka
8d25978d65 Merge branch 'PHP-8.3' into PHP-8.4 2024-11-29 08:06:10 +01:00
Jakub Zelenka
6f05d96a2b Merge branch 'PHP-8.2' into PHP-8.3 2024-11-29 07:56:28 +01:00
Jakub Zelenka
69765d9220 Fix network connect poll interuption handling
When connecting to socket, it is possible to get EINTR. In such case,
there should be an another attempt to connect if we are not over the
timeout. The timeout should be adjusted accordingly in that case.

This fixes https://github.com/phpredis/phpredis/issues/1881

Closes GH-16606
2024-11-29 07:54:06 +01:00
Pierrick Charron
fb919e885a PHP-8.4 is now for PHP 8.4.2-dev 2024-11-28 11:31:26 -05:00
Christoph M. Becker
ba6c00505d Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16849: Error dialog causes process to hang
2024-11-25 23:09:36 +01:00
Christoph M. Becker
4c5710579a Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16849: Error dialog causes process to hang
2024-11-25 23:09:13 +01:00
Christoph M. Becker
929d42de50 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16849: Error dialog causes process to hang
2024-11-25 23:08:11 +01:00
Christoph M. Becker
e75061b512 Fix GH-16849: Error dialog causes process to hang
If `_DEBUG` is set, assertion failures and errors are directed to a
debug message window by default[1].  That causes a process to hang,
since these dialogs are modal.  While we already cater to assertion
failures, errors have apparently been overlooked.

We choose a minimal fix for BC reasons; although passing `0` as
`reportMode` is undocumented, it obviously works fine for a long time.
We may consider to improve on this for the `master` branch.

[1] <https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/crtsetreportmode>

Closes GH-16850.
2024-11-25 23:04:51 +01:00
Saki Takamachi
1fd82aa13a PHP-8.4 is now for PHP 8.4.1-dev 2024-11-20 17:19:18 +09:00
Christoph M. Becker
6dec6a6dba Add PHP_BUILD_DATE constant
This information can be occasionally useful, and would otherwise need
to be parsed from `phpinfo()` output.

However, maybe more importantly we unify the build date between what is
given by `php -v` and `php -i`, since these compilation units are not
necessarily preprocessed within the same second.

Closes GH-16747.
2024-11-18 20:53:28 +01:00
Ilija Tovilo
f0b4847100 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix i386 release build warning
2024-11-14 20:39:46 +01:00
Ilija Tovilo
ec3de14afb Fix i386 release build warning
Closes GH-16730
2024-11-14 20:36:23 +01:00
Pierrick Charron
f5895792e7 PHP-8.2 is now for PHP 8.2.27-dev 2024-11-05 12:47:25 -05:00
Eric Mann
9c79ca74ef PHP-8.3 is now for PHP-8.3.15-dev 2024-11-05 07:00:09 -08:00
Christoph M. Becker
836a162089 Don't fiddle with NDEBUG in C code (GH-16511)
* Don't fiddle with NDEBUG in C code

It is way to late to do this in php.h, since assert.h has already been
included.  Even pushing that down to zend_portability.h may not have
the desired effect.  Instead we define or undefine NDEBUG as CFLAG, so
that it works in all circumstances.

As a last resort we fail at build time, if `NDEBUG` is defined when
`ZEND_DEBUG` is enabled.

We also remove the useless workaround in zend_test to include assert.h
again, since that usually won't have any effect anyway.

Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>
2024-10-27 18:20:59 +01:00
Christoph M. Becker
a1d4595d65 Fix calculation of aligned buffer size
As is, for requested size which are already aligned, we over-allocate,
so we fix this.  We also fix the allocation for chunk size 1.

This issue has been reported by @kkmuffme.

Thanks to @iluuu1994 for improving the fix!

Closes GH-16161.
2024-10-10 01:56:47 +02:00
DanielEScherzer
e34eebb854 GDB: format output for class entries and class constants (#15955)
For `zend_string` pointers in class entries, show the string contents (if not
`NULL`).

For class constants, the `ce` (class entry pointer) field is shown with the
name of the class, and the `doc_comment` field is shown with the string
contents if possible.
2024-10-09 13:10:48 +02:00
Jakub Zelenka
6f868bd6db PHP-8.3 is now for PHP-8.3.14-dev 2024-10-08 19:21:43 +01:00
Sergey Panteleev
5f5824015c PHP-8.2 is now for PHP 8.2.26-dev 2024-10-08 19:53:22 +05:00
Jakub Zelenka
ba0336c5b9 Merge branch 'PHP-8.4' 2024-10-06 19:43:44 +01:00
Jakub Zelenka
10d2d862a6 Merge branch 'PHP-8.3' into PHP-8.4 2024-10-06 19:43:19 +01:00
Jakub Zelenka
59816b9a73 Merge branch 'PHP-8.2' into PHP-8.3 2024-10-06 19:40:24 +01:00
Jakub Zelenka
5a47f27021 Fix GH-15395: php-fpm: zend_mm_heap corrupted with cgi-fcgi request
Closes GH-16227

Co-authored-by: David Carlier <devnexen@gmail.com>
2024-10-06 19:37:55 +01:00
David Carlier
9e6774d043 Merge branch 'PHP-8.4' 2024-09-30 18:11:38 +01:00
David Carlier
4ad12bdd2d Merge branch 'PHP-8.3' into PHP-8.4 2024-09-30 18:11:25 +01:00
David Carlier
d828308095 Merge branch 'PHP-8.2' into PHP-8.3 2024-09-30 18:11:14 +01:00
David Carlier
332b067c5e Fix GH-15937: stream timeout option overflow.
close GH-15942
2024-09-30 18:10:33 +01:00
Christoph M. Becker
825509ee9e Drop superfluous LONG_MAX/LONG_MIN fallback definitions (GH-15667)
Both macros are supposed to be defined in limits.h (C99) and as such it
is superfluous to provide fallback definitions.  Even worse, because
these fallback definitions didn't cater to LP64, ILP64 and SILP64 data
models (and maybe some rather uncommon ones), but just assumed ILP32,
they are confusing.
2024-09-27 17:34:54 +02:00
Ben Ramsey
91a07e7b75 Merge branch 'PHP-8.4' 2024-09-26 14:25:41 -05:00
Ben Ramsey
d854a54b5f Merge branch 'PHP-8.3' into PHP-8.4 2024-09-26 14:24:13 -05:00
Ben Ramsey
6d99ccc268 Merge branch 'PHP-8.2' into PHP-8.3 2024-09-26 14:13:00 -05:00
Ben Ramsey
c259c9f3f6 Merge branch 'PHP-8.1' into PHP-8.2 2024-09-26 13:13:46 -05:00
Ben Ramsey
fcbcf2f281 PHP-8.1 is now for PHP 8.1.31-dev 2024-09-26 12:52:41 -05:00
Christoph M. Becker
d7030c2758 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-15905: Assertion failure for TRACK_VARS_SERVER
2024-09-26 15:36:11 +02:00
Christoph M. Becker
05fce50f94 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-15905: Assertion failure for TRACK_VARS_SERVER
2024-09-26 15:35:42 +02:00
Christoph M. Becker
bf8c01db7f Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15905: Assertion failure for TRACK_VARS_SERVER
2024-09-26 15:34:34 +02:00