1
0
mirror of https://github.com/php/php-src.git synced 2026-04-09 17:13:31 +02:00
Commit Graph

5927 Commits

Author SHA1 Message Date
Peter Kokot
3030d956d9 [skip ci] Update year to 2023 (#10374) 2023-01-19 12:01:29 +01:00
George Peter Banyard
1d104f2e58 Merge branch 'PHP-8.2'
* PHP-8.2:
  Handle exceptions from __toString in XXH3's initialization
  Fix phpdbg segmentation fault in case of malformed input
2023-01-17 14:16:37 +00:00
George Peter Banyard
dd5c5ca7a5 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Handle exceptions from __toString in XXH3's initialization
  Fix phpdbg segmentation fault in case of malformed input
2023-01-17 14:16:18 +00:00
Niels Dossche
398a10a58a Fix phpdbg segmentation fault in case of malformed input
If you were to enter "w $>" the function would crash with a segmentation
fault because last_index is still NULL at that point. Fix it by checking
for NULL and erroring out if it is.

Closes GH-10353

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-17 14:12:49 +00:00
Christoph M. Becker
c8955c078a Revert GH-10220
Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit ecc880f491.
This reverts commit 588a07f737.
This reverts commit f377e15751.
This reverts commit b4ba16fe18.
This reverts commit 694ec1deea.
This reverts commit 6b34de8eba.
This reverts commit aa1cd02a43.
This reverts commit 308fd311ea.
This reverts commit 16203b53e1.
This reverts commit 738fb5ca54.
This reverts commit 9fdbefacd3.
This reverts commit cd4a7c1d90.
This reverts commit 928685eba2.
This reverts commit 01e5ffc85c.
2023-01-16 12:27:33 +01:00
Jakub Zelenka
abc41c2e00 Merge branch 'PHP-8.2' 2023-01-14 15:15:12 +00:00
Jakub Zelenka
d0dd77a3c2 Merge branch 'PHP-8.1' into PHP-8.2 2023-01-14 15:14:44 +00:00
Jakub Zelenka
7d98e3e40c Fix missing comment in FPM www.conf.in 2023-01-14 15:13:55 +00:00
Jakub Zelenka
0d74362f63 Merge branch 'PHP-8.2' 2023-01-13 10:33:51 +00:00
Jakub Zelenka
a8c387e89c Merge branch 'PHP-8.1' into PHP-8.2 2023-01-13 10:32:52 +00:00
Jakub Zelenka
120aafcc42 Fix bug #67244: Wrong owner:group for listening unix socket
Update FPM www.conf to reflect the actual logic
2023-01-13 10:31:01 +00:00
Jakub Zelenka
da4775f071 Merge branch 'PHP-8.2' 2023-01-12 13:55:47 +00:00
Jakub Zelenka
1b48a5c802 Fix ASAN reported leak in FPM config test
This happens because config test does not shutdown SAPI.

In addition this commit also fixes few failures when running FPM tests
under root.

Closes GH-10296
2023-01-12 13:52:33 +00:00
Max Kellermann
6b34de8eba sapi/*: add missing includes 2023-01-10 14:19:03 +00:00
George Peter Banyard
3b8327a4e3 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-10251: Assertion `(flag & (1<<3)) == 0' failed.
  Fix GH-9710: phpdbg memory leaks by option "-h"
2023-01-08 16:12:21 +00:00
George Peter Banyard
e308dc0635 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10251: Assertion `(flag & (1<<3)) == 0' failed.
  Fix GH-9710: phpdbg memory leaks by option "-h"
2023-01-08 16:11:46 +00:00
Niels Dossche
8ff2b6abb2 Fix GH-9710: phpdbg memory leaks by option "-h"
Closes GH-10237

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-08 16:07:00 +00:00
Max Kellermann
d53ad4b566 main/SAPI: make "ini_entries" a const string 2023-01-04 12:49:48 +00:00
David Carlier
ddcbcd135d Merge branch 'PHP-8.2' 2022-12-30 06:54:29 +00:00
David Carlier
9faa3f1695 Merge branch 'PHP-8.1' into PHP-8.2 2022-12-30 06:53:44 +00:00
Niels Dossche
3a44c78f14 Fix null pointer dereference of param
When the validation logic for param->type was added, the logic did not
account for the case where param could be NULL. The existing code did
take that into account as can be seen in the `if (param)` check below.
Furthermore, phpdbg_set_breakpoint_expression even calls
phpdbg_create_conditional_break with param == NULL.

Fix it by placing the validation logic inside a NULL check.
2022-12-30 06:53:28 +00:00
Jakub Zelenka
ff42cb0c0e Merge branch 'PHP-8.2' 2022-12-26 14:16:14 +00:00
Jakub Zelenka
21d8980d27 Fix bug #68591: Configuration test does not perform UID lookups
Addition check in fpm config test to verify existence of user, group,
listen.owner and listen.group.

Closes GH-10165
2022-12-26 14:14:14 +00:00
Jakub Zelenka
2e3d13e555 Merge branch 'PHP-8.2' 2022-12-25 14:50:34 +00:00
Jakub Zelenka
e7b6c2efd1 Merge branch 'PHP-8.1' into PHP-8.2 2022-12-25 14:49:45 +00:00
Jakub Zelenka
a3891d9d1a Fix GH-9981: FPM does not reset fastcgi.error_header 2022-12-25 14:44:25 +00:00
George Peter Banyard
b505562a45 Merge branch 'PHP-8.2' 2022-12-23 13:59:39 +00:00
George Peter Banyard
0100dbdaf8 Merge branch 'PHP-8.1' into PHP-8.2 2022-12-23 13:57:58 +00:00
Niels Dossche
5f1311a92c Fix undefined behaviour in phpdbg_load_module_or_extension
If zend_register_module_ex were to return NULL, then module_entry will
be set to NULL, and the if's body will load module_entry->name. Since
module_entry is NULL, loading the name would cause a NULL pointer
dereference. However, since a NULL pointer dereference is undefined
behaviour, the compiler is free to remove the check.
Fix it by using *name instead of module_entry->name.

Closes GH-10157

Signed-off-by: George Peter Banyard <girgias@php.net>
2022-12-23 13:55:50 +00:00
David Carlier
84988d2093 cli server addressing few todos.
Closes GH-10124.
2022-12-22 14:03:35 +00:00
Jakub Zelenka
401974ec75 Merge branch 'PHP-8.2' 2022-12-21 12:01:28 +00:00
Jakub Zelenka
891b58d503 Fix bug #77106: Missing separator in FPM FastCGI errors 2022-12-21 12:00:31 +00:00
Niels
e288438373 Remove unnecessary check of p in phpdbg_trim (#10122)
The check checks whether p is non-NULL. But if it were NULL the function
would crash in later code, so the check is useless.
It seems like *p was intended, but that is redundant as well because
isspace would return false on '\0'.
2022-12-18 03:19:10 +01:00
Arnaud Le Blanc
a11c8a3039 Limit stack size (#9104) 2022-12-16 17:44:26 +01:00
Christoph M. Becker
2ca03be46f Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-9949: Partial content on incomplete POST request
2022-12-13 15:25:39 +01:00
Christoph M. Becker
87c2f5b5a2 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-9949: Partial content on incomplete POST request
2022-12-13 15:24:07 +01:00
Christoph M. Becker
aef7d810d3 Fix GH-9949: Partial content on incomplete POST request
`ap_get_brigade()` may fail for different reasons, and we must not
pretend that a partially read POST payload is fine; instead we report
a content length of zero what matches all other `read_post()` callbacks
of bundled SAPIs.

Closes GH-10059.
2022-12-13 15:21:42 +01:00
Niels
3ab18d4d14 Change if (stack) check to an assertion (#10090)
The code checks if stack is a NULL pointer. Below that if the
stack->next pointer is updated unconditionally. Therefore a call with a
NULL pointer will crash, even though the if (stack) check seems to show
the intent that it is valid to call the function with NULL.
The function is not meant to be called with NULL, so just ZEND_ASSERT
instead.
2022-12-13 13:16:52 +01:00
David Carlier
91e70a4e6b Merge branch 'PHP-8.2' 2022-12-10 14:14:20 +00:00
David Carlier
8a221e2763 fix litespeed SAPI build warnings.
- helpers only called on linux anyway.
- proper C calls prototypes.

Closes GH-10068.
2022-12-10 14:13:30 +00:00
Jorg Adam Sowa
77ee92a50c Remove unnecessary usage of CONST_CS
Closes GH-9685.
2022-11-28 17:12:07 +01:00
Jakub Zelenka
8f95dff4d3 Merge branch 'PHP-8.2' 2022-11-23 11:37:19 +00:00
Jakub Zelenka
642fcdb781 Merge branch 'PHP-8.1' into PHP-8.2 2022-11-23 11:36:24 +00:00
Jakub Zelenka
c9c1934ff0 Fix GH-8517: FPM child pointer can be potentially uninitialized
There might be a moment when the child log event is executed after
freeing a child. That could possibly happen if the child output is
triggered at the same as the terminating of the child. Then the output
event could be potentially processed after the terminating event which
would cause this kind of issue.

The issue might got more visible after introducing the log_stream on
a child because it is more likely that this cannot be dereferenced
after free. However it is very hard to reproduce this issue so there
is no test for this.

The fix basically prevents passing a child pointer and instead passes
the child PID and then looks the child up by the PID when it is being
processed. This is obviously slower but it is a safe way to do it and
the slow down should not be hopefully visible in a way that it would
overload a master process.
2022-11-23 11:25:51 +00:00
Jakub Zelenka
2103e0921f Merge branch 'PHP-8.2' 2022-11-23 10:40:52 +00:00
Jakub Zelenka
94702c56e0 Fix bug #80669: FPM numeric user fails to set groups 2022-11-23 10:38:56 +00:00
Jakub Zelenka
0a51efe550 Merge branch 'PHP-8.2' 2022-11-22 18:22:18 +00:00
Jakub Zelenka
70777ecaca Merge branch 'PHP-8.1' into PHP-8.2 2022-11-22 18:21:50 +00:00
Jakub Zelenka
5a4520bc2b Fix bug #68207: Setting fastcgi.error_header can result in a WARNING 2022-11-22 18:17:16 +00:00
Jakub Zelenka
8ed754682a Merge branch 'PHP-8.2' 2022-11-22 18:04:10 +00:00