1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 15:08:16 +02:00
Commit Graph

5916 Commits

Author SHA1 Message Date
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
Jakub Zelenka 0e7a132918 Merge branch 'PHP-8.1' into PHP-8.2 2022-11-22 18:03:25 +00:00
Jakub Zelenka 31b20f1737 Merge branch 'PHP-8.0' into PHP-8.1 2022-11-22 18:02:11 +00:00
Petr Sumbera 72da2b02e2 php-fpm: fix Solaris port events.mechanism
Closes GH-9959.
2022-11-22 18:01:15 +00:00
George Wang 20a1d5da15 Merge branch 'PHP-8.2' 2022-11-20 19:31:02 -05:00
George Wang aef96600d3 Merge branch 'PHP-8.1' into PHP-8.2 2022-11-20 19:30:47 -05:00
George Wang aee1a2f4c0 Merge branch 'PHP-8.0' into PHP-8.1 2022-11-20 19:30:25 -05:00
George Wang 4bdfce6c1a Use __atomic_xxxx() instead of __sync_xxxx() for lsapi. 2022-11-20 19:30:07 -05:00
George Wang 27ef4517cd Revert "Use __atomic_test_and_set() instead of __sync_test_and_set() for lsapi (#7997)"
This reverts commit e57d0568d8.
2022-11-20 18:20:15 -05:00
Andy Postnikov e57d0568d8 Use __atomic_test_and_set() instead of __sync_test_and_set() for lsapi (#7997)
Related to GH-7914
2022-11-18 18:04:27 +00:00
Jakub Zelenka 7666bc5226 Merge branch 'PHP-8.2' 2022-11-13 19:08:28 +00:00
Jakub Zelenka 339bd57f42 Merge branch 'PHP-8.1' into PHP-8.2 2022-11-13 19:06:48 +00:00